Can you make it work/ does it work with Porsager-Postgres in modnes which buns Postgres client is «based on»?
I think with some tweaks to the TS parser that goes and looks for the sql statements it's doable. How are you solving the problem right now?
Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM
31–40 of 44 posts
Re: Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM
#32Those looking for a more mature solution in this space will probably enjoy SQLc [1]. It was initially developed for Go applications, but over the years it got pluggins for many other languages, including JavaScript/Typescript. [1] https://sqlc.dev/
Re: Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM
#33pretty neat, what's the technical reason it has to be Bun only?
Re: Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM
#34Kysely rules
Re: Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM
#35I don’t understand why no one is making SQL a first class citizen in a language, there are tons of languages out there that are extendable, how hard can it be, enough of DSL and generated type-safe application code which is a DSL in reverse order.
Microsoft has been doing this for a long time: https://learn.microsoft.com/en-us/dotnet/csharp/linq/
Re: Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM
#36Re: Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM
#37It also ships adapters for pretty much all platforms, for sqlite at least: bun, node, libsql, better-sqlite3, expo-sqlite, sqlite-wasm, etc. etc.
github: https://github.com/iterate/sqlfu
Re: Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM
#38Nice project, thanks! I was looking for something like that for quite a while. Any chance to get it to work with Node? Unfortunately in my opinion and experience Bun is not really suitable for production. Does it have anything special which makes this possible?
(disclaimer: i made sqlfu! and it's pretty early so use with appropriate caution. there's very little to the runtime part of it though, just very thin adapters around battle-tested clients)
Re: Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM
#39We built something quite similar - a full SQL framework with migrations, schema diffing, type-generation (this is the similar part I think), and named queries along with observability and more: https://sqlfu.dev It also ships adapters for pretty much all platforms, for sqlite at least: bun, node, libsql, better-sqlite3, expo-sqlite, sqlite-wasm, etc. etc. github: https://github.com/iterate/sqlfu
Re: Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM
#40Those looking for a more mature solution in this space will probably enjoy SQLc [1]. It was initially developed for Go applications, but over the years it got pluggins for many other languages, including JavaScript/Typescript. [1] https://sqlc.dev/
It's also a project that seems to be suffering a bit from maintainer burnout. Important bugs aren't being fixed and contributor PRs aren't being merged. It took months to merge support for the new "\restrict" syntax introduced in Postgres 17's SQL schema dump format, for example.