-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Darren Duncan wrote:
> The main rationale for the feature I mention is code brevity, 

For more context, what language are you writing your code in and how do you
get the contents of each column.  Using the C api there are 3 ways:

1 - Explicit:  "select x,y from foo" (col 0 is x, col 1 is y)
2 - Find name:  Use sqlite3_column_name to find "x" and "y"
3 - Brittle:   "select * from foo" (breaks on any schema change)

> For example, if you have a
> 8-field table and you want to return 6 fields, only having to spell out the 2 
> you don't want makes for shorter code.

But nothing happens if a ninth column is then added.  (You'll start getting
the column - there won't be errors.)  This proposal then becomes more
documentation than anything else.  A program statically analysing the
queries isn't going to be able to infer anything about correctness.  To a
human it may also look a little scary - using your users/password example,
can I tell that your code knows about a recently added 'lmhash' column?

[BTW I am a nobody so don't worry too much about this] In summary I
understand what you are saying and acknowledge that you feel this would make
your code cleaner.  However I don't see the benefits being much and would
certainly be concerned if something was added to SQLite and then a different
syntax became a standard.  I would consider myself proved wrong if there are
codebases (probably open source) showing that developers have tried to do
this sort of thing (eg functions to filter out columns).

Roger

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrAYGoACgkQmOOfHg372QSfrQCcDmSWj8c7edneWaGEI1DJwyeD
TmgAn08Ygk3phS/XzMdtFZv8TmXx8M7S
=WWXW
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to