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/actions/index.d.ts +1 -0
- package/dist/actions/introspect-db.d.ts +32 -0
- package/dist/actions/migrate-rollback.d.ts +14 -0
- package/dist/bin/cli.js +819 -235
- package/dist/client.d.ts +3 -3
- package/dist/config.d.ts +1 -15
- package/dist/db.d.ts +54 -0
- package/dist/orm.d.ts +16 -0
- package/dist/relation-utils.d.ts +27 -0
- package/dist/src/index.js +810 -229
- package/dist/types.d.ts +21 -0
- package/package.json +1 -1
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