bun-query-builder 0.1.25 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -126,6 +126,8 @@ export declare interface QueryHooks {
126
126
  onQueryEnd?: (event: { sql: string, params?: any[], durationMs: number, rowCount?: number, kind?: 'select' | 'insert' | 'update' | 'delete' | 'raw' }) => void
127
127
  onQueryError?: (event: { sql: string, params?: any[], error: any, durationMs: number, kind?: 'select' | 'insert' | 'update' | 'delete' | 'raw' }) => void
128
128
  startSpan?: (event: { sql: string, params?: any[], kind?: 'select' | 'insert' | 'update' | 'delete' | 'raw' }) => { end: (error?: any) => void }
129
+ slowQueryThresholdMs?: number
130
+ onSlowQuery?: (event: { sql: string, params?: any[], durationMs: number, kind?: 'select' | 'insert' | 'update' | 'delete' | 'raw' }) => void
129
131
  beforeCreate?: (event: { table: string, data: any }) => void | Promise<void>
130
132
  afterCreate?: (event: { table: string, data: any, result: any }) => void | Promise<void>
131
133
  beforeUpdate?: (event: { table: string, data: any, where?: any }) => void | Promise<void>
@@ -143,6 +145,24 @@ export declare interface QueryHooks {
143
145
  export declare interface FeatureToggles {
144
146
  distinctOn: boolean
145
147
  }
148
+ /**
149
+ * Connection-pool tuning for the underlying Bun SQL driver (Postgres/MySQL).
150
+ *
151
+ * All fields are optional and only apply to the network drivers — SQLite uses
152
+ * a single `bun:sqlite` handle and ignores pool settings. Timeouts are given in
153
+ * milliseconds here for ergonomics and converted to the driver's second
154
+ * resolution at connect time (sub-second values are rounded).
155
+ *
156
+ * See stacksjs/bun-query-builder#1014.
157
+ */
158
+ export declare interface PoolConfig {
159
+ max?: number
160
+ idleTimeoutMs?: number
161
+ acquireTimeoutMs?: number
162
+ maxLifetimeMs?: number
163
+ min?: number
164
+ autoReconnect?: boolean
165
+ }
146
166
  export declare interface DatabaseConfig {
147
167
  database: string
148
168
  username: string
@@ -150,6 +170,7 @@ export declare interface DatabaseConfig {
150
170
  host: string
151
171
  url?: string
152
172
  port: number
173
+ pool?: PoolConfig
153
174
  }
154
175
  /**
155
176
  * # `BrowserConfig`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-query-builder",
3
3
  "type": "module",
4
- "version": "0.1.25",
4
+ "version": "0.1.26",
5
5
  "description": "A simple yet performant query builder for TypeScript. Built with Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",