Hacker News new | ask | show | jobs
by hardwaresofton 1359 days ago
Does anyone know of a library similar to slonik[0] for SQLite in the NodeJS space?

I generally reach for TypeORM and have tried MikroORM lately but didn’t really like it.

But what I really want is something like slonik which is more focused on querying than relational mapping.

[0]: https://github.com/gajus/slonik

2 comments

You can use ts-sql-query [1]. It has a complete query builder API, but you can also use sql fragments similar to slonik. SQlite is supported along with most other mainstream databases.

[1] ts-sql-query.readthedocs.io/

MikroOrm is a pretty fantastic project IMO.

It uses Knex as the query builder so maybe you can just use that directly: https://knexjs.org/

Although, I would use Mikro still to manage schema and migrations. Then drop down to Knex: https://mikro-orm.io/docs/query-builder#using-knexjs