Common interface for SQL-based Node.js drivers (MySQL, PostgreSQL, sqlite) in BuckleScript/ReasonML. Version 6.0.0 exposes a Functor that accepts any module implementing the Queryable interface, using Belt.Result for responses. Key differentiators: provides a consistent API across SQL backends, response decoding/inspection functions, a large integer ID type (encoded as strings), batch inserts/queries, and parameter substitution with named placeholders. Designed for the ReasonML/BuckleScript ecosystem, not plain JavaScript.
npm install bs-sql-commonNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to MySQL using bs-mysql2 provider, queries SHOW DATABASES, and logs the result with error handling.
Update to use SqlCommon.Make(Provider) pattern; see migration guide.
Prefer Belt.Result for composability.
Use in a BuckleScript/ReasonML project with bsconfig.json bs-dependencies.
Set up a BuckleScript/ReasonML project with bsconfig.json and add bs-sql-common to bs-dependencies.
Define module Sql = SqlCommon.Make(MySql2) (or other provider).