Skip to content

Commit 09f99a4

Browse files
committed
Use URI#hostname to avoid interpreting :memory: as [:memory:]
1 parent 35127b2 commit 09f99a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sqlite3/connection.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class SQLite3::Connection < DB::Connection
1212
params = HTTP::Params.parse(uri.query || "")
1313

1414
Options.new(
15-
filename: URI.decode_www_form((uri.host || "") + uri.path),
15+
filename: URI.decode_www_form((uri.hostname || "") + uri.path),
1616
# pragmas
1717
busy_timeout: params.fetch("busy_timeout", default.busy_timeout),
1818
cache_size: params.fetch("cache_size", default.cache_size),
@@ -56,7 +56,7 @@ class SQLite3::Connection < DB::Connection
5656
end
5757

5858
def self.filename(uri : URI)
59-
URI.decode_www_form((uri.host || "") + uri.path)
59+
URI.decode_www_form((uri.hostname || "") + uri.path)
6060
end
6161

6262
def build_prepared_statement(query) : Statement

0 commit comments

Comments
 (0)