Overview of Slonik
mainSlonik is a battle-tested Node.js PostgreSQL client designed with strict types, detailed logging, and assertions. It is built on several core principles:
- Promotes writing raw SQL: Instead of using an abstraction layer, Slonik encourages using actual SQL.
- Discourages ad-hoc dynamic generation of SQL: It aims to prevent the unsafe and complex generation of SQL strings at runtime.
Key features include runtime validation, safe connection and transaction handling, transaction nesting, query retrying, and a rich set of interceptors (middlewares).