Implement exec_delete and exec_update methods

Signed-off-by: default avatarHenrique Varella Ehrenfried <hve13@inf.ufpr.br>
parent 64a47e8d
......@@ -42,9 +42,9 @@ monetdb/database_statements.rb
|- execute (!) - OK
|- exec_query (!) - OK Just without cache. We need to implement this later
|- exec_insert (!) - OK
|- exec_delete (!)
|- exec_delete (!) - OK
|- truncate (!)
|- exec_update (!)
|- exec_update (!) - OK
|- insert_sql (!)
|- update_sql (!)
|- delete_sql (!)
......
......@@ -61,21 +61,18 @@ module ActiveRecord
# +binds+ as the bind substitutes. +name+ is logged along with
# the executed +sql+ statement.
def exec_delete(sql, name, binds)
exec_query(sql, name, binds)
execute_and_clear(sql, name, binds) {|result| result.cmd_tuples }
end
# Executes the truncate statement.
def truncate(table_name, name = nil)
raise NotImplementedError
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
alias :exec_update :exec_delete # implements exec_update
# Executes the truncate statement.
def truncate(table_name, name = nil)
raise NotImplementedError
end
protected
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.

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment