On Jun 26, 2019, at 11:11 AM, Simon Slavin <slav...@bigfraud.org> wrote:
> 
> I too have missed sample code from the SQLite documentation.  I agree that 
> there are some drawbacks to including it.  But there are some things, like 
> the correct sequence is for understanding ROLLBACKs, which are strange and 
> complicated when explained in text but are far easier to understand when seen 
> as sample code.

It would be nice to have one good example below each racetrack diagram.  This 
set of examples doesn’t have to be comprehensive; I agree with the other 
arguments on this point.  It’s just that it’s easier to read a racetrack 
diagram when you’ve got a worked example showing how all of the verbs and nouns 
get strung together into a working bit of SQL code.

It would also be nice to have examples in the SQLite docs wherever SQLite 
deviates significantly from the rest of the SQL world:

1. Joins.  If you aren’t careful to include “SQLite” in your web search terms, 
you’ll often get code that just won’t execute on SQLite, because most of the 
result pages are written by people running DBMSes that allow them to create a 
RIGHT OUTER UPSIDE DOWN INVERSE DOUBLE JOIN WITH EXTRA SPIN.

2. ALTER TABLE.  SQLite’s implementation of this is sufficiently low-featured 
that one often wants common workarounds.  You can find a dozen web sites that 
will give you a sensible workaround for SQLite’s lack of, say, DROP COLUMN, but 
it’d be nice to find it in the SQLite docs, too.

3. Lack of types.  Some DBMSes have a data type for every strange thing they’ve 
been asked for by the Fortune 500 over the past 4 decades, but not SQLite.  
There should be a set of recipes to work around SQLite’s relatively small set 
of built-in types.  For instance, there’s no specific TIMESTAMP type, but you 
can construct one with an INTEGER and the built-in data/time functions.  That 
drags in pros-and-cons discussions of time_t vs Julian dates, etc.

There’s also the collapsing of types in SQLite, which is currently fairly 
well-documented, here:

    https://www.sqlite.org/datatype3.html#affinity_name_examples

For example, the fact that SQLite really doesn’t make any distinction between, 
say, VARCHAR(255) and TEXT.  What I want, then, is for that table to be more 
comprehensive, so that whatever weird data type you search for, you either get 
a simple mapping to one of SQLite’s few base data types or to a recipe showing 
how to construct a suitable alternative.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to