mirror of
https://gitea.invidious.io/iv-org/shard-crystal-sqlite3.git
synced 2024-08-15 00:53:26 +00:00
Updated to Crystal > 0.15.0
This commit is contained in:
parent
6e1a6fe225
commit
b1c6c32ae5
4 changed files with 7 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
||||||
name: sqlite3
|
name: sqlite3
|
||||||
version: 0.2.0
|
version: 0.3.0
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- Ary Borenszweig <aborenszweig@manas.com.ar>
|
- Ary Borenszweig <aborenszweig@manas.com.ar>
|
||||||
|
|
|
@ -59,7 +59,7 @@ class SQLite3::Database
|
||||||
# ```
|
# ```
|
||||||
def dump(to : SQLite3::Database)
|
def dump(to : SQLite3::Database)
|
||||||
backup_item = LibSQLite3.backup_init(to.@db, "main", @db, "main")
|
backup_item = LibSQLite3.backup_init(to.@db, "main", @db, "main")
|
||||||
if backup_item.nil?
|
if backup_item.null?
|
||||||
raise Exception.new(to.@db)
|
raise Exception.new(to.@db)
|
||||||
end
|
end
|
||||||
code = LibSQLite3.backup_step(backup_item, -1)
|
code = LibSQLite3.backup_step(backup_item, -1)
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# ```
|
# ```
|
||||||
class SQLite3::ResultSet
|
class SQLite3::ResultSet
|
||||||
# :nodoc:
|
# :nodoc:
|
||||||
def initialize(@statement)
|
def initialize(@statement : Statement)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the number of columns.
|
# Returns the number of columns.
|
||||||
|
@ -50,7 +50,7 @@ class SQLite3::ResultSet
|
||||||
when LibSQLite3::Code::DONE
|
when LibSQLite3::Code::DONE
|
||||||
false
|
false
|
||||||
else
|
else
|
||||||
raise Exception.new(@db)
|
raise Exception.new(@statement.db)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
# A statement represents a prepared-but-unexecuted SQL query.
|
# A statement represents a prepared-but-unexecuted SQL query.
|
||||||
class SQLite3::Statement
|
class SQLite3::Statement
|
||||||
|
getter db
|
||||||
|
|
||||||
# :nodoc:
|
# :nodoc:
|
||||||
def initialize(@db, sql)
|
def initialize(@db : Database, sql : String)
|
||||||
check LibSQLite3.prepare_v2(@db, sql, sql.bytesize + 1, out @stmt, nil)
|
check LibSQLite3.prepare_v2(@db, sql, sql.bytesize + 1, out @stmt, nil)
|
||||||
@closed = false
|
@closed = false
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue