You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to automatically generate types from the database queries. To do this:
Build an SQL parser that is flexible in how it handles placeholders that could be replaced with other SQL, and which supports a reasonable subset of the postgres/mysql/sqlite syntax - being worked on in feat: create an SQL parser #20
Write util to extract queries from typescript files
Write util to extract type from parsed SQL query and database schema
Tie everything together in an awesome CLI
The text was updated successfully, but these errors were encountered:
Re the SQL parser - ideally it supports the entire grammar for each dialect. I built https://github.com/stevenmiller888/ts-mysql-parser for the language service plugin, on top of Antlr4 with the grammar extracted from MySQL workbench. The beauty of it is that you can specify the version you want. Working with Antlr4 was a pretty pleasant experience btw, and it looks like they have a full grammar ready-to-go for sqlite.
The pg-typed/mysql-typed approach seems to have worked well enough here to cover 99% of the use case. I no longer think it's a worthwhile idea right now to attempt to generate types from raw SQL queries.
I would like to be able to automatically generate types from the database queries. To do this:
The text was updated successfully, but these errors were encountered: