Skip to content
Snippets Groups Projects
Commit 1e1b0fd1 authored by Henrique Varella Ehrenfried's avatar Henrique Varella Ehrenfried
Browse files

Implement exec_delete and exec_update methods

parent 64a47e8d
No related branches found
No related tags found
No related merge requests found
...@@ -42,9 +42,9 @@ monetdb/database_statements.rb ...@@ -42,9 +42,9 @@ monetdb/database_statements.rb
|- execute (!) - OK |- execute (!) - OK
|- exec_query (!) - OK Just without cache. We need to implement this later |- exec_query (!) - OK Just without cache. We need to implement this later
|- exec_insert (!) - OK |- exec_insert (!) - OK
|- exec_delete (!) |- exec_delete (!) - OK
|- truncate (!) |- truncate (!)
|- exec_update (!) |- exec_update (!) - OK
|- insert_sql (!) |- insert_sql (!)
|- update_sql (!) |- update_sql (!)
|- delete_sql (!) |- delete_sql (!)
......
...@@ -61,21 +61,18 @@ module ActiveRecord ...@@ -61,21 +61,18 @@ module ActiveRecord
# +binds+ as the bind substitutes. +name+ is logged along with # +binds+ as the bind substitutes. +name+ is logged along with
# the executed +sql+ statement. # the executed +sql+ statement.
def exec_delete(sql, name, binds) def exec_delete(sql, name, binds)
exec_query(sql, name, binds) execute_and_clear(sql, name, binds) {|result| result.cmd_tuples }
end end
# Executes update +sql+ statement in the context of this connection using
# +binds+ as the bind substitutes. +name+ is logged along with
# the executed +sql+ statement.
alias :exec_update :exec_delete # implements exec_update
# Executes the truncate statement. # Executes the truncate statement.
def truncate(table_name, name = nil) def truncate(table_name, name = nil)
raise NotImplementedError raise NotImplementedError
end end
# Executes update +sql+ statement in the context of this connection using
# +binds+ as the bind substitutes. +name+ is logged along with
# the executed +sql+ statement.
def exec_update(sql, name, binds)
exec_query(sql, name, binds)
end
protected protected
def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil)
......
  • O método execute_and_clear é implementado no adaptador postgresql_adapter.rb:583 e usa os métodos da gem pg

    No caso do MonetDB, é necessário utilizar como referência os métodos da monetdb-sql, em particular das classes MonetDB e MonetDBData.

    Implementi hoje pela manhã uma versão inicial da DatabaseStatement na branch fix_adapter usando os métodos da monetdb_sql.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment