On 2017/03/15 5:36 PM, Richard Hipp wrote:
On 3/15/17, Bob Friesenhahn <bfrie...@simple.dallas.tx.us> wrote:
On Wed, 15 Mar 2017, R Smith wrote:
CREATE TABLE "test" (
  "ID" INTEGER /* Here we add column comments */,
  "Name" TEXT /* Note the comma is AFTER the comment */,
  "EMail" TEXT COLLATE NOCASE /* Username (Unique Key) */,
CONSTRAINT UI_test_EMail UNIQUE (EMail) /* This is an Index comment */
) /* and this is a Table comment, before the final semi-colon  */;

This will be kept exactly as-is in the SQL field of the schema table
(main.sqlite_master) and is easy to parse out later, or use a standard
tool
Are these comments loaded into memory used by each program which
connects to the database?  If so, more resources are consumed.
The comments are loaded into memory temporarily while the CREATE TABLE
statement is being parsed when the connection is first opened, but
they are not held in memory long-term.  The text of the CREATE TABLE
is freed as soon as the schema parse completes.  So there is no extra
long-term memory usage.

I wonder, sqlite Devs, if a pragma or other adaption (such as the current pragma table_info()) or such could produce the same exact data but with an added field called "Comment" that simply gives the parsed comment from after each column definition (if any) like the above table example. This would probably be a very small adaptation, be completely backwards compatible, doesn't break any standard (since there isn't any) and answer the need expressed by this thread and others before it.


_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to