Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan committed May 9, 2008
1 parent 6fc1072 commit 6116156
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion lib/savepoints.rb
Expand Up @@ -55,7 +55,28 @@ def savepoint_name(savepoint_number)
end
end

MysqlAdapter.class_eval do
class MysqlAdapter < AbstractAdapter
def create_savepoint(savepoint_number)
execute("SAVEPOINT #{savepoint_name(savepoint_number)}")
true
rescue Exception
# Savepoints are not supported
end

def rollback_to_savepoint(savepoint_number)
execute("ROLLBACK TO SAVEPOINT #{savepoint_name(savepoint_number)}")
rescue Exception
# Savepoints are not supported
end

def release_savepoint(savepoint_number)
execute("RELEASE SAVEPOINT #{savepoint_name(savepoint_number)}")
rescue Exception
# Savepoints are not supported
end
end

class PostgreSQLAdapter < AbstractAdapter
def create_savepoint(savepoint_number)
execute("SAVEPOINT #{savepoint_name(savepoint_number)}")
true
Expand Down

0 comments on commit 6116156

Please sign in to comment.