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

Strict mode by default when tables are strict #321

Open
aplavin opened this issue Jan 23, 2023 · 3 comments
Open

Strict mode by default when tables are strict #321

aplavin opened this issue Jan 23, 2023 · 3 comments

Comments

@aplavin
Copy link
Contributor

aplavin commented Jan 23, 2023

SQLite supports "strict" mode since 2021: https://www.sqlite.org/stricttables.html. Can SQLite use its strict mode automatically whenever the sqlite database uses it? Should help type stability and performance.

@metab0t
Copy link
Collaborator

metab0t commented Jan 23, 2023

I think it is all about SQL?

@aplavin
Copy link
Contributor Author

aplavin commented Jan 24, 2023

I don't understand the question.
With strict mode, sqlite enforces actual data types to match table schema. This can be used in SQLite.jl to determine types once for a query, and then read all rows type-stably with fewer julia allocations and better performance.

@metab0t
Copy link
Collaborator

metab0t commented Jan 24, 2023

It means that SQLite.jl needs to parse the table name(s) from SQL first, runs PRAGMA table_list(tbl) to tell whether the table is strict and PRAGMA schema.table_xinfo(tbl) to get types of all columns.
I am afraid that it is not worth the additional complexities for a wrapper of SQLite APIs.
Anyway, welcome PR and performance comparisons.

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

2 participants