From 15f2e7d3676f4bd8da581cef3715de82b345ff0b Mon Sep 17 00:00:00 2001 From: Ciro Spaciari Date: Fri, 29 Aug 2025 18:07:54 -0700 Subject: [PATCH] fix error --- src/js/internal/sql/shared.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/js/internal/sql/shared.ts b/src/js/internal/sql/shared.ts index ea552caa0b..f717c0328f 100644 --- a/src/js/internal/sql/shared.ts +++ b/src/js/internal/sql/shared.ts @@ -569,7 +569,13 @@ function parseUrlForAdapter(urlString: string, adapter: Bun.SQL.__internal.Adapt try { return new URL(defaultProtocol + urlString); } catch (error) { - return new URL(encodeURI(defaultProtocol + urlString)); + try { + // can be a "sqlite://file with empty spaces.db" + return new URL(encodeURI(defaultProtocol + urlString)); + } catch { + // throw the original error if the URL is invalid + throw error; + } } }