Possible bug in cli: .schema --indent mishandles trailing comments

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Possible bug in cli: .schema --indent mishandles trailing comments

Trevor
Here is a sample output to illustrate the problem of mishandled
trailing comments. The original create table statement included
two leading spaces for each attribute.

$ sqlite3 ~/db-lib/data.db

SQLite version 3.17.0 2017-02-13 16:02:40
Enter ".help" for usage hints.
sqlite> .schema rating_answer
CREATE TABLE rating_answer (
  id            integer primary key,
  idQuestion    references rating_question (id),
  response      integer not null,  -- 1=strongly dislike, 5=strongly like
  answertext    text not null,
  status        integer, -- 0 not active, 1=active
  datecreated   text not null
);
CREATE UNIQUE INDEX rating_answer_idx on rating_answer (idQuestion, response);

sqlite> .schema --indent rating_answer
CREATE TABLE rating_answer(
  id integer primary key,
  idQuestion references rating_question(id),
  response integer not null,
  -- 1=strongly dislike,
  5=strongly like
  answertext text not null,
  status integer,
  -- 0 not active,
  1=active
  datecreated text not null
);
CREATE UNIQUE INDEX rating_answer_idx on rating_answer(
  idQuestion,
  response
);

sqlite> .q
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...