-
Notifications
You must be signed in to change notification settings - Fork 85
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
Replace sqlite3 with sqlean #220
base: main
Are you sure you want to change the base?
Conversation
@@ -361,7 +361,7 @@ def run_cli(self): | |||
else: | |||
history = None | |||
self.echo( | |||
'Error: Unable to open the history file "{}". ' "Your query history will not be saved.".format(history_file), | |||
'Error: Unable to open the history file "{}". Your query history will not be saved.'.format(history_file), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the formatting done by ruff.
assert set(executor.table_columns()) == set([("a", "x"), ("a", "y"), ("b", "z"), ("t", "t")]) | ||
assert set(executor.tables()) == set([("sqlean_define",), ("a",), ("b",), ("t",)]) | ||
assert set(executor.table_columns()) == set( | ||
[("sqlean_define", "type"), ("sqlean_define", "body"), ("sqlean_define", "name"), ("a", "x"), ("a", "y"), ("b", "z"), ("t", "t")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding extra table and columns from sqlean define
Here is a simple benchmark # -*- coding: utf-8 -*-
from litecli.main import LiteCli
import timeit
def perf():
dbname=":memory:"
cli = LiteCli()
cli.connect(dbname)
# Create a table
cli.run_query("create table test (a text)")
# Insert 10000 rows
for i in range(10000):
cli.run_query(f'insert into test values("{i}")')
# Delete the table
cli.run_query("drop table test")
def main():
# timeit is not needed when using hyperfine
print(timeit.timeit("perf()", globals=globals(), number=10))
if __name__ == "__main__":
main() Default Sqlite3
Sqlean
I don't see much deviation in performance and I think it should be okay. Let me know what you think. |
Description
Notes:
Checklist
CHANGELOG.md
file.