BunPostgreSQLProviderclass
new BunPostgreSQLProvider<I, T>(sql: SQL)
| Param | Type | |
|---|---|---|
sql | SQL | The Bun.SQL instance to execute queries against. required |
| Return | |
|---|---|
BunPostgreSQLProvider<I, T> | PostgreSQL database provider backed by Bun's built-in Bun.SQL driver. |
PostgreSQL database provider backed by Bun's built-in Bun.SQL driver.
Implements the PostgreSQLProvider SQL abstraction by executing tagged-template queries against a Bun.SQL connection.
- Identifiers are escaped through
Bun.SQL's ownsql()helper rather than naive string quoting, which is more secure. - Requires the
bunpeer dependency and a running Bun environment.
Examples
import { SQL } from "bun";
const provider = new BunPostgreSQLProvider(new SQL(process.env.DATABASE_URL));