Replies: 2 comments
-
I feel that's an infeasible goal. For one, Sequel supports a wide variety of SQL features, and not all databases support those features. In some cases, Sequel will raise an error before sending an error to the database (mostly for backwards compatibility), but in general, Sequel does what you ask it to do. If the database doesn't support what you are asking it to do, you should fix your code. SQLite does not support composite types, so it raises an error. The code you provided works on PostgreSQL, where it returns a composite/row type. As the documentation explains, |
Beta Was this translation helpful? Give feedback.
-
Ok, I'm sure you're right. Han Holl |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
If you do:
pp Items.select([:name, :address])
you get:
#<Sequel::Dataset::_Subclass: "SELECT (
name
,address
) FROMmain
">Sqlite3 gives the quite unhelpful message: row value misused, because it doesn't like the parentheses in the select clause.
Switch to braces:
pp Items.select{[:name, :address]}
and
#<Sequel::Dataset::_Subclass: "SELECT
name
,address
FROMmain
">is of course ok.
I feel tha sequel shouldn't emit SQL that a database doesn't handle.
Han Holl
Beta Was this translation helpful? Give feedback.
All reactions