awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
gajus avatar

gajus/slonik

0
View on GitHub↗
4,910 stars·157 forks·TypeScript·11 views

Slonik

Slonik is a type-safe PostgreSQL client for Node.js that uses tagged template literals to ensure parameters are bound and protected against injection attacks. It provides a framework for connecting applications to PostgreSQL with automatic type checking for queries and database schemas.

The project distinguishes itself through a specialized SQL query linter that detects invalid columns and type mismatches by verifying code against a live database schema during the development process. It also includes a high-performance binary bulk data inserter for loading large datasets using native binary serialization and a connection pool manager capable of dynamic query routing between primary and replica nodes.

The library covers a broad set of database capabilities, including atomic transaction management, dynamic SQL query building, and the processing of large result sets via async-iterable streaming. It further provides middleware interceptors for logging and benchmarking, custom type parsing, and asynchronous callback mechanisms for refreshing database authentication credentials.

Features

  • Parameterized SQL Templates - Uses tagged template literals to automatically bind parameters, ensuring type safety and preventing SQL injection attacks.
  • Type-Safe Integrations - Connects Node.js applications to PostgreSQL with automatic type checking for queries and database schemas.
  • SQL Query Linting - Ships a specialized SQL query linter that detects invalid columns and type mismatches against a live database schema.
  • PostgreSQL Pool Managers - Implements a connection pool manager specifically tailored for PostgreSQL database connections in Node.js.
  • Raw SQL Execution - Enables execution of raw SQL statements using secure parameter binding via tagged templates.
  • Atomic Transaction Execution - Implements mechanisms to wrap multiple queries in atomic transactions that roll back on failure.
  • Database Transaction Wrappers - Wraps multiple database queries within a single transaction session to ensure atomicity and consistency.
  • Connection Pool Managers - Includes a connection pool manager to optimize resource utilization and support dynamic routing between primary and replica nodes.
  • Database Transaction Management - Provides tools for managing database transaction boundaries and ensuring data integrity through atomic operations.
  • PostgreSQL Node.js Clients - Provides a type-safe PostgreSQL driver for Node.js using tagged template literals.
  • Strongly-Typed Query Validation - Verifies the structure of database outputs using schema validation to ensure type safety at runtime.
  • SQL Schema Validators - Provides build-time verification of SQL queries against a live database schema to detect type mismatches and invalid columns.
  • Async Iterable Streams - Provides memory-efficient processing of large database result sets using async iterable streams.
  • Database Query Builders - Offers a fluent interface for programmatically constructing complex SQL statements with conditional clauses.
  • SQL Query Builders - Provides a tool for constructing composable SQL fragments with build-time and runtime schema validation.
  • Result Streaming - Provides memory-efficient retrieval of large database result sets using async-iterable streaming.
  • Traffic Routing - Directs database queries to primary or replica instances based on the operation type.
  • Bulk Record Insertions - Implements high-speed bulk record insertion by converting nested data structures into binary formats.
  • Binary Format Insertions - Offers high-speed loading of large datasets using native binary serialization for optimized PostgreSQL insertion.
  • SQL Query Building - Facilitates the programmatic construction of secure SQL statements using fluent APIs and parameter binding.
  • SQL Query Validators - Ships a specialized SQL query linter that verifies code against a live database schema during development.
  • Databases - PostgreSQL client with strict typing and logging.
  • Object Relational Mappers - PostgreSQL client with strict typing and logging.
  • Database Drivers - Node.js database driver.

Star history

Star history chart for gajus/slonikStar history chart for gajus/slonik

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Projects sharing features with Slonik

These projects share indexed features with Slonik. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • felixge/node-mysqlfelixge avatar

    felixge/node-mysql

    18,621View on GitHub↗

    This project is a pure JavaScript database driver for Node.js that implements the native MySQL binary protocol. It serves as a comprehensive connector for managing persistent network links to MySQL servers, enabling applications to execute queries, manage transactions, and handle complex data operations without requiring external middleware. The driver distinguishes itself through its integrated support for connection pooling and distributed database routing. It maintains managed sets of reusable network sockets to optimize resource usage under high request volumes, while simultaneously provi

    JavaScript
    View on GitHub↗18,621
  • tgriesser/knextgriesser avatar

    tgriesser/knex

    20,314View on GitHub↗

    Knex is a programmatic SQL query builder for Node.js applications. It provides a unified interface for generating database statements and managing structural versioning through a schema migration tool. The project features a multi-dialect database layer that translates programmatic queries into specific syntax for relational databases including PostgreSQL, MySQL, SQLite3, and MSSQL. This allows for writing database logic that remains compatible across different systems. The system includes infrastructure for managing reusable database connection pools and handling relational transactions to

    JavaScript
    View on GitHub↗20,314
  • vincit/objection.jsVincit avatar

    Vincit/objection.js

    7,343View on GitHub↗

    Objection.js is an object-relational mapper for Node.js that maps SQL database tables to classes and rows to model instances. It functions as a high-level abstraction layer built on top of the Knex.js query builder to provide structured model definitions and relational data mapping. The project distinguishes itself through its ability to manage complex object graphs, allowing for the persistence and eager-loading of deeply nested related data in single operations. It incorporates a data integrity layer that uses JSON schema validation to verify model instances before they are persisted to the

    JavaScript
    View on GitHub↗7,343
  • go-pg/pggo-pg avatar

    go-pg/pg

    5,785View on GitHub↗

    pg is a PostgreSQL object-relational mapper (ORM) for Go that maps Go structs to database tables and provides a fluent query builder for constructing SQL statements programmatically. At its core, it automatically generates CREATE TABLE statements from Go struct definitions using struct tags and naming conventions, and builds queries through method chaining with placeholder-based parameter binding to prevent SQL injection. The library distinguishes itself through relation-aware join generation that automatically constructs JOIN clauses for has-one, has-many, many-to-many, and polymorphic assoc

    Go
    View on GitHub↗5,785
Compare all 30 related projects→

Frequently asked questions

What does gajus/slonik do?

Slonik is a type-safe PostgreSQL client for Node.js that uses tagged template literals to ensure parameters are bound and protected against injection attacks. It provides a framework for connecting applications to PostgreSQL with automatic type checking for queries and database schemas.

What are the main features of gajus/slonik?

The main features of gajus/slonik are: Parameterized SQL Templates, Type-Safe Integrations, SQL Query Linting, PostgreSQL Pool Managers, Raw SQL Execution, Atomic Transaction Execution, Database Transaction Wrappers, Connection Pool Managers.

Which projects share features with gajus/slonik?

Projects with overlapping indexed features include: felixge/node-mysql — This project is a pure JavaScript database driver for Node.js that implements the native MySQL binary protocol. It… tgriesser/knex — Knex is a programmatic SQL query builder for Node.js applications. It provides a unified interface for generating… vincit/objection.js — Objection.js is an object-relational mapper for Node.js that maps SQL database tables to classes and rows to model… go-pg/pg — pg is a PostgreSQL object-relational mapper (ORM) for Go that maps Go structs to database tables and provides a fluent… porsager/postgres — This project is a PostgreSQL client library and SQL query builder for JavaScript and TypeScript. It provides a… dotnetcore/freesql — FreeSql is a .NET object-relational mapper and data access layer that translates object-oriented code into SQL for…