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

Create sqlite index tables from JSONSchema definitions in @mapeo/schema #122

Closed
Tracked by #139
gmaclennan opened this issue Jul 12, 2023 · 0 comments
Closed
Tracked by #139
Assignees

Comments

@gmaclennan
Copy link
Member

gmaclennan commented Jul 12, 2023

We need a way to generate sql CREATE TABLE statements based on the JSONSchema definitions (only top-level properties - nested props to be stored as JSON in SQLite).

We can generate SQL statements ourselves from JSON Schema to generate extraColumns, or we can use a helper like Drizzle-kit, which also gives us added benefits of typed sql select statements. Drizzle provides a nice API for this. I think it will be easier to map our JSOn schema to the drizzle table schema API than it would be to generate CREATE TABLE SQL statements manually from JSON Schema.

See #135

This will also give us typed db.select() functions for our datatype API, which will give a bit more typesafety for that part of the code.

@gmaclennan gmaclennan changed the title Use drizzle-orm for SQLite table schemas and read queries Create sqlite index tables from JSONSchema definitions in @mapeo/schema Jul 26, 2023
@gmaclennan gmaclennan self-assigned this Aug 1, 2023
@gmaclennan gmaclennan linked a pull request Aug 1, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant