From 253faed1cfdf5bbec81fccbc3b0f58e97102e5d6 Mon Sep 17 00:00:00 2001 From: Ciro Spaciari Date: Thu, 6 Feb 2025 13:37:58 -0800 Subject: [PATCH] fix(sql) types (#17118) --- packages/bun-types/bun.d.ts | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/bun-types/bun.d.ts b/packages/bun-types/bun.d.ts index bfe9476bef..6165587db6 100644 --- a/packages/bun-types/bun.d.ts +++ b/packages/bun-types/bun.d.ts @@ -2009,35 +2009,35 @@ declare module "bun" { */ type SQLOptions = { /** Connection URL (can be string or URL object) */ - url: URL | string; + url?: URL | string; /** Database server hostname */ - host: string; + host?: string; /** Database server port number */ - port: number | string; + port?: number | string; /** Database user for authentication */ - username: string; + username?: string; /** Database password for authentication */ - password: string; + password?: string; /** Name of the database to connect to */ - database: string; + database?: string; /** Database adapter/driver to use */ - adapter: string; - /** Maximum time in milliseconds to wait for connection to become available */ - idleTimeout: number; - /** Maximum time in milliseconds to wait when establishing a connection */ - connectionTimeout: number; - /** Maximum lifetime in milliseconds of a connection */ - maxLifetime: number; + adapter?: string; + /** Maximum time in seconds to wait for connection to become available */ + idleTimeout?: number; + /** Maximum time in seconds to wait when establishing a connection */ + connectionTimeout?: number; + /** Maximum lifetime in seconds of a connection */ + maxLifetime?: number; /** Whether to use TLS/SSL for the connection */ - tls: boolean; + tls?: TLSOptions | boolean; /** Callback function executed when a connection is established */ - onconnect: (client: SQL) => void; + onconnect?: (client: SQL) => void; /** Callback function executed when a connection is closed */ - onclose: (client: SQL) => void; + onclose?: (client: SQL) => void; /** Maximum number of connections in the pool */ - max: number; + max?: number; /** By default values outside i32 range are returned as strings. If this is true, values outside i32 range are returned as BigInts. */ - bigint: boolean; + bigint?: boolean; }; /**