InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now. Learn more →
Slonik Alternatives
Similar projects and alternatives to slonik
-
-
InfluxDB
InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
-
Prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
-
-
-
-
TypeORM
ORM for TypeScript and JavaScript. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.
-
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
Knex
A query builder for PostgreSQL, MySQL, CockroachDB, SQL Server, SQLite3 and Oracle, designed to be flexible, portable, and fun to use.
-
drizzle-orm
Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
-
prisma1
Discontinued 💾 Database Tools incl. ORM, Migrations and Admin UI (Postgres, MySQL & MongoDB) [deprecated]
-
-
postgres
Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare (by porsager)
-
kysely
Discontinued A type-safe typescript SQL query builder [Moved to: https://github.com/kysely-org/kysely] (by koskimas)
-
-
-
JDBI
The Jdbi library provides convenient, idiomatic access to relational databases in Java and other JVM technologies such as Kotlin, Clojure or Scala.
-
-
-
Sequelize
Feature-rich ORM for modern Node.js and TypeScript, it supports PostgreSQL (with JSON and JSONB support), MySQL, MariaDB, SQLite, MS SQL Server, Snowflake, Oracle DB (v6), DB2 and DB2 for IBM i.
-
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
slonik discussion
slonik reviews and mentions
- ArkType: Ergonomic TS validator 100x faster than Zod
-
Sqlc: Compile SQL to type-safe code
Didn’t use myself, but AFAIK slonik library is doing what you’ve described: https://github.com/gajus/slonik
-
Show HN: TypeScript SQL Query API Engine for Postgres
Some time ago I started working on this query API engine, a sort of layer on top of slonik[1], to abstract the most tedious parts of using straight SQL (dynamic filtering, paginating etc).
The idea was to make it easy to create typesafe querying APIs, similar to ORMs I was using at the time, but using pure SQL. I was also inspired by hasura's GraphQL API engine, but wanted to build something simpler for tRPC APIs, thus the name.
I've also built a small playground where you can see the raw SQL queries that are created when you run the API [2]
It's a proof of concept that I've used to build APIs with a lot of dynamic filters and complex sub-queries, I'd love to know your thoughts on it!
[1]: https://github.com/gajus/slonik
[2]: https://sql-api-playground.netlify.app/
-
Sneakiest development trap: making easy easier...
And sometimes invest instead in learning a technology rather than hide it: for example slonik encourages you to write normal SQL queries by making SQL templating easier and safer. In turn, your IDE would be able to understand those queries and give you support based on the database schemas you actually have.
-
Drizzle is just as unready for prime-time as Prisma, what else is there?
I'd push you to consider using postgres, slonik or similar for database queries. With these libraries, you just write SQL, but they perform input sanitization for you. So you can safely write:
- Slonik: PostgreSQL client for Node.js with runtime validation
-
PostgresJs: The Fastest full featured PostgreSQL client for Node.js and Deno
You can already use postgres with Slonik.
https://github.com/gajus/slonik#user-content-slonik-how-are-...
It is not going to be the default because it is way slower.
https://github.com/gajus/slonik/actions/runs/6616647651
Test node_version:18 test_only:postgres-integration is taking 3 minutes.
Test node_version:18 test_only:pg-integration is taking 38 seconds.
-
Integrating Slonik with Express.js
For those uninitiated, Slonik is a battle-tested SQL query building and execution library for Node.js. Its primary goal is to allow you to write and compose SQL queries in a safe and convenient way. Now, let's see how it pairs with Express.js.
-
Which Postgres client are you using?
I am the maintainer of Slonik and I am trying to understand what portion of this sub-users are using Slonik vs other libraries, and if they are using anything else – what are their reasons for it.
-
JEP Draft: String Templates (Final)
It's nice that they implemented string templates essentially exactly the same way Javascript template literals and tag functions work. They even give an example of using it to create a prepared statement (e.g. DB."SELECT * FROM foo WHERE bar = \{inputParam}") which is exactly what many NodeJS libraries due, e.g. Slonik https://github.com/gajus/slonik, like sql`SELECT * FROM foo WHERE bar = ${inputParam}`;
-
A note from our sponsor - InfluxDB
www.influxdata.com | 25 Jun 2025
Stats
gajus/slonik is an open source project licensed under GNU General Public License v3.0 or later which is an OSI approved license.
The primary programming language of slonik is TypeScript.