{"repo":"marcobambini/sqlite-createtable-parser","free":true,"listed":false,"github":"https://github.com/marcobambini/sqlite-createtable-parser","clone":"git clone https://github.com/marcobambini/sqlite-createtable-parser.git","description":"A parser for SQLite create table sql statements.","language":"C","stars":138,"topics":["sqlite","sqlite3","parse","c","parser"],"license":"MIT","category":"databases-storage","readme_excerpt":"SQLite CREATE and ALTER TABLE Parser A parser for SQLite CREATE TABLE and ALTER TABLE statements. Extremely fast zero-copy parser (strings point directly into the input SQL buffer) MIT licensed with no dependencies (just drop the two files into your project) Never recurses or allocates more memory than it needs Simple opaque-type API with accessor functions Supports STRICT tables, generated columns, and all constraint types Motivation SQLite is a very powerful software but it lacks an easy way to extract complete information about tables and columns constraints. This drawback in addition to the lack of full ALTER TABLE support makes alterring a table a very hard task. The built-in sqlite pragmas provide incomplete information and a manual parsing is required in order to extract all the metadata from a table. CREATE TABLE syntax diagrams can be found on the official sqlite website. Pre-requisites - A C99 compiler. - SQL statement must be successfully compiled by SQLite. Usage In order to extract the original CREATE TABLE sql statement you need to query the sqlite master table from within an SQLite database: then just include sql3parse table.h and sql3parse table.c in your project and invoke: sql3table is an opaque struct that you can introspect using the sql3table public functions. API Example Parse a CREATE TABLE statement and inspect it: A more complete dump utility is available in test/sql3parse debug.h and test/sql3parse debug.c . Implementing a Complete ALTER TABLE in SQL","default_branch":null,"files":null,"tree":[],"storefront":"/r/marcobambini","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/marcobambini/sqlite-createtable-parser/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}