Updated to Crystal > 0.15.0

This commit is contained in:
Ary Borenszweig 2016-04-12 00:02:16 -03:00
parent 6e1a6fe225
commit b1c6c32ae5
4 changed files with 7 additions and 5 deletions

View file

@ -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>

View file

@ -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)

View file

@ -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

View file

@ -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