mirror of
https://github.com/lloeki/rebel.git
synced 2025-12-06 10:04:39 +01:00
Tests
This commit is contained in:
parent
3415cf8ad4
commit
2155aa8d43
5 changed files with 75 additions and 5 deletions
|
|
@ -9,13 +9,17 @@ module Rebel::SQL
|
|||
exec(Rebel::SQL.create_table(table_name, desc))
|
||||
end
|
||||
|
||||
def drop_table(table_name)
|
||||
exec(Rebel::SQL.drop_table(table_name))
|
||||
end
|
||||
|
||||
def select(*fields, from: nil, where: nil, inner: nil, left: nil, right: nil)
|
||||
exec(Rebel::SQL.select(*fields,
|
||||
from: from,
|
||||
where: where,
|
||||
inner: inner,
|
||||
left: left,
|
||||
right: right))
|
||||
from: from,
|
||||
where: where,
|
||||
inner: inner,
|
||||
left: left,
|
||||
right: right))
|
||||
end
|
||||
|
||||
def insert_into(table_name, *rows)
|
||||
|
|
@ -77,6 +81,12 @@ module Rebel::SQL
|
|||
SQL
|
||||
end
|
||||
|
||||
def drop_table(table_name)
|
||||
<<-SQL
|
||||
DROP TABLE #{Rebel::SQL.name(table_name)};
|
||||
SQL
|
||||
end
|
||||
|
||||
def select(*fields, from: nil, where: nil, inner: nil, left: nil, right: nil)
|
||||
<<-SQL
|
||||
SELECT #{names(*fields)} FROM #{name(from)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue