Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
valenterry
21 days ago
|
parent
|
context
|
favorite
| on:
Litdb – type safe SQL for JavaScript/TS
I like it. First glance and they chose the "proper" order (from -> where -> select) over the classical order (select -> from -> where). Probably because that improves/enables autocomplete and typehandling. This is good
aethr
21 days ago
[–]
Using (from -> where -> select), how would you provide type hints on the where clause when your select includes non-table columns?
SELECT COUNT(col_a) as count WHERE count > 0
Kysely uses (from -> select -> where), and allows joins and selects in multiple places, like (from -> join -> select -> join -> select -> where).
valenterry
20 days ago
|
parent
[–]
Maybe I'm mistaken right now, but I think your query is invalid. You cannot refer to an select-alias (here "count") in a where-condition.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: