4 ms·
All I really want is inference for queries, like the JetBrains IDEs kinda do it. I can write something like this (pseudocode): username = '31337' result =
by super256 4y ago
All I really want is inference for queries, like the JetBrains IDEs kinda do it.
I can write something like this (pseudocode):
username = '31337'
result = db.query('SELECT username, email FROM users WHERE username = 1?', username)
And it would automatically show annotations for `result`, straight from the database:
result?: {
username: string,
email?: string
}
- GeorgeHoneywood 4y agoThis is pretty much the idea behind sqlc, with some extra steps of course. You write your SQL queries in file, and it generates type safe bolierplate for you. https://github.com/kyleconroy/sqlc https://github.com/kyleconroy/sqlc