-
Notifications
You must be signed in to change notification settings - Fork 81
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
STRICT tables seem to not be supported #157
Comments
Hey, I think this can be related to which sqlite3 versions you have on your system, and which litecli defaults to use. See here: https://discuss.python.org/t/how-to-use-the-new-sqlite-strict-keyword-with-python-3/13322/2 The following works for me: litecli test.db
test.db> CREATE TABLE u (name TEXT) STRICT;
Query OK, 0 rows affected
Time: 0.013s However this does not: sqlite3 test.db
SQLite version 3.32.3 2020-06-18 14:00:33
Enter ".help" for usage hints.
sqlite> CREATE TABLE u (name TEXT) STRICT;
Error: near "STRICT": syntax error However the latter was done outside an environment, where the working example was inside an environment. Which litecli version are you on? Interesting enough, even inside the environment this does not work: sqlite3 test.db
SQLite version 3.32.3 2020-06-18 14:00:33
Enter ".help" for usage hints.
sqlite> .tables
Error: malformed database schema (u) - near "STRICT": syntax error Litecli uses pythons sqlite3 extension module which in my python, version 3.11 in my environment, requires SQLite 3.7.15 or newer. Outside of my environment my python is version 3.8.3. My guess is that in your case it uses the sqlite shipped with python3.9, which possibly will be an older version of SQLite than what you run from your terminal. What do you see in In any case I think installing Litecli from a newer python version, Python 3.8 python3 -m venv "python38venv"
source python38venv/bin/activate
python -m pip install litecli
litecli test.db
test.db> CREATE TABLE u (name TEXT) STRICT;
near "STRICT": syntax error Python 3.11 python3.11 -m venv "python311venv"
source python311venv/bin/activate
python -m pip install litecli
litecli test.db
test.db> CREATE TABLE u (name TEXT) STRICT;
Query OK, 0 rows affected
Time: 0.012s Sorry for the rambling answer :) |
Hi,
As of version 3.37.0 (2021-11-27), SQLite supports STRICT tables. However, the LiteCLI client seems to choke on tables defined this way.
Steps to reproduce:
sqlite3 test.db
sqlite> CREATE TABLE u (name TEXT) STRICT;
litecli test.db
This last command then gives:
The text was updated successfully, but these errors were encountered: