On 2 Mar 2013, at 1:24pm, kyan <alfasud...@gmail.com> wrote: > On Tue, Jan 1, 2013 at 8:01 PM, Peter Haworth <p...@lcsql.com> wrote: >> There are plenty of third party tools out there that will take care of >> adding/removing constraints to existing tables and a whole lot of other >> functions that aren't available in SQLite's DDL, while accounting for all >> their secondary effects. > > About these functions that are not available in DDL, are they part of > SQLite source? Are they part of the interface? They don't seem to be > documented anywhere. Maybe they are available only for third party > tool developers? How can someone get documentation for them?
SQLite isn't at its root a DDL. It's a C API, fully documented here: <http://www.sqlite.org/capi3ref.html> That's SQLite and that's its full documentation. As designed, to add SQLite facilities to your programming project you simply include the C source code (.c and .h files) that implements those commands into your project. That's the 'amalgamation source' you see us talking about on this list. Any DDL you see is someone trying to make some or all of those things accessible as a DDL. People who make DDLs for SQLite can put as many or as few of these things into their DDL as they like, along with as many things they made up themselves as they like. There is more than one DDL and for all we know they might all be different to one-another. If you want to know about a particular DDL, go find the documentation for that DDL. Having said that, the GUI admin tools and DDLs which implement something like adding/removing constraints usually doesn't include new low-level C code to fiddle with the database like the source code does. They normally does it by using various API calls in a way that looks like you're doing just one call. For instance, to add a new constraint to an existing table ... ALTER TABLE myTable ADD CONSTRAINT (capacity > 0) <-- imaginary command for discussion only they do this: 1. Get the old table definition as a text string. 2. Add the constraint to the definition. 3. Create a new table with this new definition. 4. Copy all the data in the old table into the new table. 5. Drop the old table. 6. Rename the new table with the old table's name. You can do all the above yourself using just SQLite commands which are already in the API. All they've done is specify one command in the DDL which does them all for just one call. (There are complications which mean that you cannot do exactly the above and expect everything to work perfectly. I'm using it just as a demonstration.) Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users