2014-03-19 02:06:44 +00:00
|
|
|
module DdlHelper
|
|
|
|
def with_example_table(connection, table_name, definition = nil)
|
2014-06-10 10:09:58 +00:00
|
|
|
connection.execute("CREATE TABLE #{table_name}(#{definition})")
|
2014-03-19 02:06:44 +00:00
|
|
|
yield
|
|
|
|
ensure
|
2014-06-10 10:09:58 +00:00
|
|
|
connection.execute("DROP TABLE #{table_name}")
|
2014-03-19 02:06:44 +00:00
|
|
|
end
|
|
|
|
end
|