Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Emulate selecting without FROM table on Firebird

  • Loading branch information...
commit 3fac0a9eed0701ac369e2844f8c03062cd31251c 1 parent d73165c
@jeremyevans authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/sequel/adapters/shared/firebird.rb
View
10 lib/sequel/adapters/shared/firebird.rb
@@ -154,6 +154,7 @@ module DatasetMethods
INSERT_CLAUSE_METHODS = Dataset.clause_methods(:insert, %w'insert into columns values returning')
FIRST = " FIRST ".freeze
SKIP = " SKIP ".freeze
+ DEFAULT_FROM = " FROM RDB$DATABASE"
# Insert given values into the database.
def insert(*values)
@@ -206,6 +207,15 @@ def select_clause_methods
SELECT_CLAUSE_METHODS
end
+ # Use a default FROM table if the dataset does not contain a FROM table.
+ def select_from_sql(sql)
+ if @opts[:from]
+ super
+ else
+ sql << DEFAULT_FROM
+ end
+ end
+
def select_limit_sql(sql)
if l = @opts[:limit]
sql << FIRST
Please sign in to comment.
Something went wrong with that request. Please try again.