-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug with virtual tables in statemnts
Virtual tables can exist on a single statement and do not show up in the db schema, so skip them when testing for rowid columns.
- Loading branch information
1 parent
75b28d4
commit 6eed277
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'spec_helper' | ||
require 'amalgalite/sqlite3' | ||
require 'rbconfig' | ||
|
||
describe "Amalgalite handles the JSON extension" do | ||
it "can parse a `json_each` call" do | ||
db = Amalgalite::Database.new( ":memory:" ) | ||
values = %w[ a b c d e f g ] | ||
db.execute("CREATE TABLE jtest(id, json)") | ||
db.execute("INSERT INTO jtest(id, json) values (1, json($json))", { "$json" => values }) | ||
rows = db.execute("SELECT jtest.id as i, value as v FROM jtest, json_each(jtest.json)") | ||
|
||
rows.size.should eq(values.size) | ||
end | ||
end |