mirror of
https://gitea.invidious.io/iv-org/shard-crystal-sqlite3.git
synced 2024-08-15 00:53:26 +00:00
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:
parent
46709eab00
commit
9784573152
4 changed files with 32 additions and 11 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue