On 05/29/2014 03:42 PM, big stone wrote:
Hello,

I miss the functionnality of some other sql motors that keep the comments
inside an object definition, like a table.

Example : (with sqlite.exe 3.8.3)

create table /* This table has an educative purpose */ toto(x);
create table /* This table has an educative purpose */
                    toty(    x  );
create table
     totz(    x  );
select sql from sqlite_master;

... gives :
CREATE TABLE TOTO(X)
CREATE TABLE TOTY(    X  )
CREATE TABLE
    TOTZ(X)

... instead of the original  full statements :
create table /* This table has an educative purpose */ toto(x)
create table /* This table has an educative purpose */
                    toty(    x  )
create table
     totz(    x  )


This sounds quite illogical, as :
-  Newlines and spaces are kept, (if not around a comment)
-  the SQLite internal parser would re-parse (and remove comments) from the
original statement without issue.

I think in practice the text that appears before the first "(" character in the CREATE TABLE statement is replaced by "CREATE TABLE <tblname>". This is because if the user enters "CREATE TABLE main.<tblname>" we don't want to store "main." in the sqlite_master file. So I'd say if the comment appears inside the parenthesis it will probably be preserved.

Of course, even if that is correct, it's just an artifact of the implementation, not part of a published interface that one would expect not to change in future versions.

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

Reply via email to