kysely-org / kysely

A type-safe typescript SQL query builder
https://kysely.dev
MIT License
9.81k stars 249 forks source link

feat: add the starts-with postgres comparison operator #1029

Closed boehs closed 3 weeks ago

boehs commented 4 weeks ago

https://www.postgresql.org/docs/current/spgist-builtin-opclasses.html#SPGIST-BUILTIN-OPCLASSES-TABLE

There are a lot more operators as well that are arguably even more esoteric, not sure this can scale forever but.

see #891 and #1012. worth noting that sql<boolean> doesn’t currently work, but what you can do is

eb("tag", sql`^@`, ".").$castTo<boolean>()
vercel[bot] commented 4 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kysely ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2024 8:15am
koskimas commented 3 weeks ago

worth noting that sql\<boolean> does not currently work.

What made you think it would? It's mentioned as one potential solution for the issue. As in "this is what we could do to solve this issue".

boehs commented 3 weeks ago

I just mistakenly understood what that was getting at, I’ll update the PR body