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

Stricter typechecking #14

Open
trevyn opened this issue Mar 9, 2021 · 1 comment
Open

Stricter typechecking #14

trevyn opened this issue Mar 9, 2021 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@trevyn
Copy link
Owner

trevyn commented Mar 9, 2021

SQLite is flexibly typed, a philosophy which doesn't harmonize well with Rust's preference for strong types.

Despite this flexible typing, SQLite provides access to the underlying type of result columns of individual rows, and rusqlite exposes this via, for example:

These can be used to enforce additional typechecking at runtime, instead of the usual behavior of coercing types.

@trevyn trevyn added the help wanted Extra attention is needed label Mar 9, 2021
@trevyn
Copy link
Owner Author

trevyn commented Oct 27, 2021

Also incoming soon: SQLite STRICT tables:

https://www.sqlite.org/draft/stricttables.html

Doesn't directly support BOOLEAN, but other than that pretty nice. Note that derived columns should still be runtime typechecked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant