Closed Spierki closed 7 years ago
I can suggest this simple working fix because there is no easy way to run parametrized queries through ActiveRecord::Base.connection:
module RailsDb
module Adapters
class BaseAdapter
extend ::RailsDb::Connection
# ...
def self.delete(table_name, pk_name, pk_id)
case pk_id
when Fixnum, Bignum then
execute("DELETE FROM #{table_name} WHERE #{pk_name} = #{pk_id}")
else
execute("DELETE FROM #{table_name} WHERE #{pk_name} = '#{pk_id}'")
end
end
Yes, looks good. Could you make a PR with this fix?
Done
Given this table definition :
RailsDB raises this exception when I try to delete a record :
It looks like RailsDB do not support UUID primary keys.