mirror of
https://gitea.invidious.io/iv-org/shard-crystal-sqlite3.git
synced 2024-08-15 00:53:26 +00:00
Documentation and some refactors
This commit is contained in:
parent
d96255d766
commit
d62185867b
10 changed files with 215 additions and 45 deletions
|
@ -61,6 +61,18 @@ describe Database do
|
|||
end
|
||||
end
|
||||
|
||||
it "gets column types" do
|
||||
Database.new(":memory:") do |db|
|
||||
db.execute "create table person (name string, age integer)"
|
||||
db.execute %(insert into person values ("foo", 10))
|
||||
stmt = db.prepare("select * from person")
|
||||
stmt.execute
|
||||
stmt.step
|
||||
stmt.types.should eq([Type::TEXT, Type::INTEGER])
|
||||
stmt.close
|
||||
end
|
||||
end
|
||||
|
||||
it "gets column by name" do
|
||||
Database.new(":memory:") do |db|
|
||||
db.execute "create table person (name string, age integer)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue