TEXT can always be read back as a String

If you store something like "1234" in a STRING field, SQLite will return
an Int64. Better to be more specific, for uses who play around with the
example code.

See crystal-lang/crystal-db#49.
This commit is contained in:
Hinrik Örn Sigurðsson 2017-11-13 13:20:36 +01:00
parent adf64daa08
commit 8cdf5e15ae
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ dependencies:
require "sqlite3" require "sqlite3"
DB.open "sqlite3://./data.db" do |db| DB.open "sqlite3://./data.db" do |db|
db.exec "create table contacts (name string, age integer)" db.exec "create table contacts (name text, age integer)"
db.exec "insert into contacts values (?, ?)", "John Doe", 30 db.exec "insert into contacts values (?, ?)", "John Doe", 30
args = [] of DB::Any args = [] of DB::Any