Very long generated names for SQL-in-TS
See original GitHub issueExample:
sql`
insert into users(email, stripe_id, password)
values($email, $stripe_id, $password)
returning *
`
Generated:
export interface ISqlSignupQueryInsertIntoUsersEmailStripeIdPasswordValuesEmailStripeIdPasswordReturningQuery {
params: ISqlSignupQueryInsertIntoUsersEmailStripeIdPasswordValuesEmailStripeIdPasswordReturningParams;
result: ISqlSignupQueryInsertIntoUsersEmailStripeIdPasswordValuesEmailStripeIdPasswordReturningResult;
}
That’s 92 characters.
I tried including a comment with @name
but it didn’t have any effect. It would be great if it worked and allows users to give names to queries.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Table name length in sqlite affects performance. Why?
With the longer table names, the resulting empty database file is 4x larger, since the longer table names take up more space in...
Read more >SQLite Generated Columns
By definition, generated columns are the columns of a table whose values are derived from an expression that involves other columns of the...
Read more >SQLite Frequently Asked Questions
Short answer: A column declared INTEGER PRIMARY KEY will autoincrement. Longer answer: If you declare a column of a table to be INTEGER ......
Read more >SQLite Keywords
The SQL standard specifies a large number of keywords which may not be used as the names of tables, indices, columns, databases, user-defined...
Read more >Implementation Limits For SQLite
SQLite is able to limit the size of a database file to prevent the database file from growing too large and consuming too...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@adelsz thanks for the workaround! I played around with possible solutions a bit.
It looks like there is a hard requirement in the parser to have something of the form of
Which means I can’t do
I think it would be a nice usability improvement to make concise statements like mine possible. Splitting up is totally okay but introduces some redundancy imo.
Would you be open to allowing something like
/* @name Signup */
in thesql
template literals? I wouldn’t mind helping out and submitting a PR.Sorry for the late reply @chmln. We can allow
@name
declarations in TS literals as a workaround for your specific usecase. Please feel free to open a PR.