Permalink
Browse files

making sure the insert specs pass

  • Loading branch information...
1 parent acfa0ad commit 98fdfb880c673bc082cf28db58ba9d948a47454f @camilo committed Apr 24, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/sequel/adapters/vertica.rb
View
12 lib/sequel/adapters/vertica.rb
@@ -19,14 +19,18 @@ def connect(server)
:ssl => opts[:ssl] )
end
- def execute(sql, opts={}, &block)
+ def execute(sql, opts = {}, &block)
synchronize(opts[:server]) do |conn|
res = conn.query(sql)
res.each(&block)
end
end
- alias_method :execute_insert, :execute
+ def execute_insert(sql, opts = {}, &block)
+ result = execute(sql, opts, &block)
+ result.first[:OUTPUT]
+ end
+
alias_method :execute_dui, :execute
def supports_create_table_if_not_exists?
@@ -49,6 +53,10 @@ def identifier_output_method_default
nil
end
+ def locks
+ dataset.from(:v_monitor__locks)
+ end
+
def schema_parse_table(table_name, opts)
selector = [:column_name, :constraint_name, :is_nullable.as(:allow_null),
(:column_default).as(:default), (:data_type).as(:db_type)]

0 comments on commit 98fdfb8

Please sign in to comment.