diff --git a/samples/memory.cr b/samples/memory.cr index 87e02cc..4b2ee5c 100644 --- a/samples/memory.cr +++ b/samples/memory.cr @@ -8,7 +8,7 @@ DB.open "sqlite3://%3Amemory%3A" do |db| args = [] of DB::Any args << "Sarah" args << 33 - db.exec "insert into contacts values (?, ?)", args + db.exec "insert into contacts values (?, ?)", args: args puts "max age:" puts db.scalar "select max(age) from contacts" # => 33 diff --git a/shard.yml b/shard.yml index ec671f1..35f2ad7 100644 --- a/shard.yml +++ b/shard.yml @@ -4,12 +4,12 @@ version: 0.16.0 dependencies: db: github: crystal-lang/crystal-db - version: ~> 0.9.0 + version: ~> 0.10.0 authors: - Ary Borenszweig - Brian J. Cardiff -crystal: 0.28.0 +crystal: 0.35.0 license: MIT diff --git a/src/sqlite3/connection.cr b/src/sqlite3/connection.cr index 5079c3c..54d1d96 100644 --- a/src/sqlite3/connection.cr +++ b/src/sqlite3/connection.cr @@ -9,11 +9,7 @@ class SQLite3::Connection < DB::Connection end def self.filename(uri : URI) - {% if compare_versions(Crystal::VERSION, "0.30.0-0") >= 0 %} - URI.decode_www_form((uri.host || "") + uri.path) - {% else %} - URI.unescape((uri.host || "") + uri.path) - {% end %} + URI.decode_www_form((uri.host || "") + uri.path) end def build_prepared_statement(query) : Statement diff --git a/src/sqlite3/statement.cr b/src/sqlite3/statement.cr index c5dc619..06289fb 100644 --- a/src/sqlite3/statement.cr +++ b/src/sqlite3/statement.cr @@ -1,7 +1,7 @@ class SQLite3::Statement < DB::Statement - def initialize(connection, sql) - super(connection) - check LibSQLite3.prepare_v2(sqlite3_connection, sql, sql.bytesize + 1, out @stmt, nil) + def initialize(connection, command) + super(connection, command) + check LibSQLite3.prepare_v2(sqlite3_connection, command, command.bytesize + 1, out @stmt, nil) end protected def perform_query(args : Enumerable) : DB::ResultSet