Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.schema: line breaks and missing index information #149

Open
balta2ar opened this issue Sep 13, 2022 · 3 comments
Open

.schema: line breaks and missing index information #149

balta2ar opened this issue Sep 13, 2022 · 3 comments

Comments

@balta2ar
Copy link

sqlite:

→ sqlite3 imdb-cmudb2022.db
SQLite version 3.37.2 2022-01-06 13:25:41
Enter ".help" for usage hints.
sqlite> .schema people
CREATE TABLE people (
  person_id VARCHAR PRIMARY KEY,
  name VARCHAR,
  born INTEGER,
  died INTEGER
);
CREATE INDEX ix_people_name ON people (name);
sqlite>

litecli:

→ litecli imdb-cmudb2022.db
Version: 1.9.0
Mail: https://groups.google.com/forum/#!forum/litecli-users
GitHub: https://github.com/dbcli/litecli
imdb-cmudb2022.db> .schema people
+--------------------------------------------------------------------------------------------------------------+
| sql                                                                                                          |
+--------------------------------------------------------------------------------------------------------------+
| CREATE TABLE people (\n  person_id VARCHAR PRIMARY KEY,\n  name VARCHAR,\n  born INTEGER,\n  died INTEGER\n) |
+--------------------------------------------------------------------------------------------------------------+
Time: 0.012s
imdb-cmudb2022.db>
@kracekumar
Copy link
Contributor

I guess, in the latest version, \nis properly parsed and not sure if it's related to any OS/shell combo.

Definitely index is missing.

LiteCli: 1.14.4 (SQLite: 3.47.1)
test.db> CREATE TABLE people (
           person_id VARCHAR PRIMARY KEY,
           name VARCHAR,
           born INTEGER,
           died INTEGER
         );
Query OK
Time: 0.003s
test.db> CREATE INDEX ix_people_name ON people (name);
Query OK
Time: 0.002s
test.db> .schema people
+----------------------------------+
| sql                              |
+----------------------------------+
| CREATE TABLE people (            |
|   person_id VARCHAR PRIMARY KEY, |
|   name VARCHAR,                  |
|   born INTEGER,                  |
|   died INTEGER                   |
| )                                |
+----------------------------------+
Time: 0.006s
test.db>

@kracekumar
Copy link
Contributor

I can see sqlite supports both .schema and .indexcommand.

sqlite> .schema people1
CREATE TABLE people1(
  person_id VARCHAR PRIMARY KEY,
  name VARCHAR,
  born INTEGER,
  died INTEGER
);
CREATE INDEX ix_people_name_2 ON people1 (name);
sqlite> .index people1
ix_people_name_2            sqlite_autoindex_people1_1
sqlite>

@amjith
Copy link
Member

amjith commented Mar 10, 2025

@balta2ar Can you upgrade to the latest version of litecli and let me know if the line breaks are still broken?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants