6 ms·
No worries! I enjoyed checkout out your implementation! I think such a tool would be complicated to implemented. I was thinking maybe of integrating with tagge
by jbaudanza 5y ago
No worries! I enjoyed checkout out your implementation!
I think such a tool would be complicated to implemented. I was thinking maybe of integrating with tagged template literals somehow. Maybe something like:
db.query(sql`SELECT COUNT(*) FROM users`)
And then some tool could parse the AST to find all the SQL and generate types.
- deleted 5y ago[deleted]
- guntars 5y agoHow about keeping the query as a separate, importable .sql file that can be analyzed by a tool and it could spit out the typings to a .sql.d.ts file? The editor support for mixing languages in a single file was not great, last time I checked.