Those 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 may be a good choice for golang, but support for other languages is not as great.

I remember creating a PR [1] for some very obvious issues with Typescript generator for better-sqlite3 some two years ago which never received any attention from maintainers. There are bunch of such PRs languishing in obscurity in their repos.

[1] https://github.com/sqlc-dev/sqlc-gen-typescript/pull/45

And sqlx on the Rust side just for completeness