Hello,

If you use Dataset#select(:col1, :col2), sequel will generate sql
like:

select ( `col1`, `col2` ) from ...

Sqlite3 doesn't like the parentheses, and generates a syntax error.
Here's a simpleminded patch to /sequel_core/dataset/sql.rb
--- sql.rb.orig 2008-10-15 22:31:22.000000000 +0200
+++ sql.rb      2008-10-28 12:37:36.000000000 +0100
@@ -601,6 +601,7 @@

       columns = opts[:select]
       select_columns = columns ? column_list(columns) : WILDCARD
+      select_columns = select_columns[1..-2] if select_columns[0] == ?
(

       if distinct = opts[:distinct]
         distinct_clause = distinct.empty? ? "DISTINCT" : "DISTINCT ON
(#{expression_list(distinct)})"

As I said, it's no beauty, but it works without doing too much harm.

Cheers,

Han Holl
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to