Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
5a1f894
refactor: Fix Bun.SQL options parsing to separate adapter detection a…
Aug 29, 2025
666aea0
fix: Correct MYSQL_URL protocol detection in adapter inference
Aug 29, 2025
6f75091
test: Add comprehensive MySQL port defaulting tests
Aug 29, 2025
669e022
fix: Infer adapter from environment variable names when protocol is m…
Aug 29, 2025
7dba454
refactor: Simplify adapter inference to prioritize environment variab…
Aug 29, 2025
c19c865
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 29, 2025
0906de4
feat: Add comprehensive MySQL environment variable support
Aug 29, 2025
bb89714
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 29, 2025
952300f
test: Add SSL mode verification for TLS environment variable tests
Aug 29, 2025
5128275
feat: Add comprehensive adapter-protocol validation with conflict det…
Aug 29, 2025
cdeefff
Complete SQL options parsing refactor
Aug 29, 2025
0bc8e6b
Fix SQL options precedence: explicit options override URL parameters
Aug 29, 2025
251268f
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 29, 2025
79996d1
fix linter
cirospaciari Aug 29, 2025
f0174a7
fix parseurlForAdapter
cirospaciari Aug 30, 2025
0009922
fix coderabbit issues
cirospaciari Aug 30, 2025
d4a15c4
fix error
cirospaciari Aug 30, 2025
f456566
fix more
cirospaciari Aug 30, 2025
98399e1
dont discard tls
cirospaciari Aug 30, 2025
a98c72e
revert shared for now
alii Aug 30, 2025
c99dfab
fix: redo connection parsing logic
alii Sep 2, 2025
562732d
normalize url protocol for parsing
alii Sep 2, 2025
b6a923f
missing TLS_MYSQL_DATABASE_URL when no adapter is specified in options
alii Sep 2, 2025
50b3b6e
enhance connection details parsing to include adapter detection and i…
alii Sep 2, 2025
ab3d771
refactor getConnectionDetailsFromEnvironment to streamline adapter de…
alii Sep 2, 2025
747576d
fix tests
alii Sep 2, 2025
a02583c
get more tests to pass
alii Sep 2, 2025
72fd476
cleanup
alii Sep 3, 2025
40b41c2
enhance SQL connection handling by introducing OptionsWithDefinedAdap…
alii Sep 3, 2025
1e7a3a7
fix: all tests passing
alii Sep 3, 2025
9203d57
refactor parseConnectionDetailsFromOptionsOrEnvironment to improve SQ…
alii Sep 3, 2025
75f139e
expect :memory: for blank path
alii Sep 3, 2025
a4a58ed
significant cleanup work
alii Sep 3, 2025
5d90887
satisfy typescript
alii Sep 3, 2025
5cb76d4
tidier
alii Sep 3, 2025
cf3f0c7
mariadb should have its own case
alii Sep 3, 2025
32943dd
default to sslMode.disable
alii Sep 3, 2025
9c5bd46
undo meaningless changes
alii Sep 3, 2025
ed8ce4f
test should have a timeout
alii Sep 3, 2025
8289b1b
this should not have been reverted
alii Sep 3, 2025
b8ec02e
tests are passing but could do with a cleanup
alii Sep 3, 2025
36fc3dc
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 3, 2025
d9522d2
refactor SQLite URL handling and connection options parsing for clari…
alii Sep 3, 2025
a2fc0d5
Merge branch 'ali/fix-sql-connection-string-parsing' of github.com:ov…
alii Sep 3, 2025
6fae93d
change
alii Sep 3, 2025
ba96b16
smaller
alii Sep 3, 2025
3052718
tidier
alii Sep 3, 2025
421a6b8
make sqlite special case easier to understand
alii Sep 3, 2025
f756a3e
fix connection string parsing url when adapter is not sqlite, but a n…
alii Sep 3, 2025
5d66a20
skip unix socket tests on windows
alii Sep 3, 2025
c2180b7
Empty filename should default to :memory:
alii Sep 3, 2025
3d9de4d
mariadb case
alii Sep 3, 2025
bfe6166
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 3, 2025
0588916
Revert launch.json
alii Sep 3, 2025
5d92536
fix: Make passing tests actually pass with better env resetting
alii Sep 3, 2025
6ac21ca
make sql errors much less noisy (omit undefined properties by default)
alii Sep 3, 2025
c6e735c
fix: Satisfy oxlint declaration merging
alii Sep 3, 2025
36fa997
Merge branch 'main' into ali/fix-sql-connection-string-parsing
alii Sep 3, 2025
6b149c4
fallback tls value
alii Sep 3, 2025
520a9b5
use `await using` in a test
alii Sep 3, 2025
2d1817d
try ci
alii Sep 4, 2025
677eefe
revert tls changes and try ci
alii Sep 4, 2025
6cd8d93
see if changes are related
alii Sep 4, 2025
e382508
debug
alii Sep 4, 2025
b04a3f9
dont listen on mysql.sock in precedence test
alii Sep 4, 2025
e0714d9
Fix Unix domain socket cleanup on listener.stop()
Sep 4, 2025
382f687
fix: should work with unix requires the path to exist
alii Sep 4, 2025
884f2f3
Merge branch 'main' into ali/fix-sql-connection-string-parsing
alii Sep 5, 2025
4a52927
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 5, 2025
e292748
fix: deprecate .ssl in the options since it's an alias of tls
alii Sep 5, 2025
d03b861
update docs & dont use regex for checking protocol
alii Sep 6, 2025
ba1e261
Merge branch 'main' into ali/fix-sql-connection-string-parsing
alii Sep 6, 2025
4ca6dcc
Merge branch 'main' into ali/fix-sql-connection-string-parsing
alii Sep 6, 2025
6ed13e9
ci: try run this on windows
alii Sep 6, 2025
4372d30
cleanup test
alii Sep 6, 2025
cefe202
remove Bun.listen changes for now
alii Sep 6, 2025
c3129d3
Merge branch 'main' into ali/fix-sql-connection-string-parsing
alii Sep 6, 2025
32a6a90
changes + unlink
alii Sep 6, 2025
34648f2
small cleaning in harness
alii Sep 8, 2025
ff91fc1
Merge branch 'main' into ali/fix-sql-connection-string-parsing
alii Sep 8, 2025
db15759
changes to types
alii Sep 8, 2025
c691df7
skip tls-sql.test.ts when no connection string secrets locally
alii Sep 8, 2025
2c85900
Merge branch 'main' into ali/fix-sql-connection-string-parsing
alii Sep 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/bun-types/sql.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,15 @@ declare module "bun" {
*/
type Options = SQLiteOptions | PostgresOrMySQLOptions;

/**
* A type with all properties in any of the possible Options union values.
*
* For example, this contains {@link SQLiteOptions.safeIntegers} as well as
* {@link PostgresOrMySQLOptions.host}, where both are optional as they
* would be in their respective original options.
*/
type MergedOptions = Bun.__internal.DistributedMerge<SQL.Options>;

/**
* Represents a SQL query that can be executed, with additional control
* methods Extends Promise to allow for async/await usage
Expand Down Expand Up @@ -524,7 +533,7 @@ declare module "bun" {
/**
* Current client options
*/
options: Bun.__internal.DistributedMerge<SQL.Options>;
options: SQL.MergedOptions;

/**
* Commits a distributed transaction also know as prepared transaction in postgres or XA transaction in MySQL
Expand Down
Loading