mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
Enumerate columns in result_set
This commit is contained in:
parent
344804dd79
commit
5773faaa5c
2 changed files with 21 additions and 0 deletions
|
@ -41,5 +41,19 @@ describe DB::ResultSet do
|
|||
end
|
||||
the_rs.closed?.should be_true
|
||||
end
|
||||
|
||||
it "should enumerate columns" do
|
||||
cols = [] of String
|
||||
|
||||
with_dummy do |db|
|
||||
db.query "3,4 1,2" do |rs|
|
||||
rs.each_column do |col, col_type|
|
||||
cols << col
|
||||
col_type.should eq(Slice(UInt8))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
cols.should eq(["c0", "c1"])
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue