Add Bool support

* change specs to not use #scalar since it does not have expected type information.
* refactor Time spec
This commit is contained in:
Brian J. Cardiff 2016-12-14 13:52:12 -03:00
parent 46709eab00
commit 9784573152
4 changed files with 32 additions and 11 deletions

View file

@ -59,6 +59,10 @@ class SQLite3::ResultSet < DB::ResultSet
Time.parse read(String), SQLite3::DATE_FORMAT
end
def read(t : Bool.class) : Bool
read(Int64) != 0
end
def column_count
LibSQLite3.column_count(self)
end

View file

@ -37,6 +37,10 @@ class SQLite3::Statement < DB::Statement
check LibSQLite3.bind_null(self, index)
end
private def bind_arg(index, value : Bool)
check LibSQLite3.bind_int(self, index, value ? 1 : 0)
end
private def bind_arg(index, value : Int32)
check LibSQLite3.bind_int(self, index, value)
end