module Rebel::SQLQ
Attributes
conn[R]
Public Instance Methods
count(*n)
click to toggle source
# File lib/rebel/sql.rb, line 48 def count(*n) Rebel::SQL.count(*n) end
create_table(table_name, desc)
click to toggle source
# File lib/rebel/sql.rb, line 10 def create_table(table_name, desc) exec(Rebel::SQL.create_table(table_name, desc)) end
delete_from(table_name, where: nil, inner: nil, left: nil, right: nil)
click to toggle source
# File lib/rebel/sql.rb, line 40 def delete_from(table_name, where: nil, inner: nil, left: nil, right: nil) exec(Rebel::SQL.delete_from(table_name, where: where, inner: inner, left: left, right: right)) end
drop_table(table_name)
click to toggle source
# File lib/rebel/sql.rb, line 14 def drop_table(table_name) exec(Rebel::SQL.drop_table(table_name)) end
exec(query)
click to toggle source
# File lib/rebel/sql.rb, line 6 def exec(query) conn.exec(query) end
insert_into(table_name, *rows)
click to toggle source
# File lib/rebel/sql.rb, line 32 def insert_into(table_name, *rows) exec(Rebel::SQL.insert_into(table_name, *rows)) end
join(table, on: nil)
click to toggle source
# File lib/rebel/sql.rb, line 52 def join(table, on: nil) Rebel::SQL.join(table, on: on) end
outer_join(table, on: nil)
click to toggle source
# File lib/rebel/sql.rb, line 56 def outer_join(table, on: nil) Rebel::SQL.outer_join(table, on: on) end
select(*fields, distinct: nil, from: nil, where: nil, inner: nil, left: nil, right: nil, group: nil, order: nil, limit: nil, offset: nil)
click to toggle source
# File lib/rebel/sql.rb, line 18 def select(*fields, distinct: nil, from: nil, where: nil, inner: nil, left: nil, right: nil, group: nil, order: nil, limit: nil, offset: nil) exec(Rebel::SQL.select(*fields, distinct: distinct, from: from, where: where, inner: inner, left: left, right: right, group: group, order: order, limit: limit, offset: offset)) end
truncate(table_name)
click to toggle source
# File lib/rebel/sql.rb, line 44 def truncate(table_name) exec(Rebel::SQL.truncate(table_name)) end
update(table_name, set: nil, where: nil, inner: nil, left: nil, right: nil)
click to toggle source
# File lib/rebel/sql.rb, line 36 def update(table_name, set: nil, where: nil, inner: nil, left: nil, right: nil) exec(Rebel::SQL.update(table_name, set: set, where: where, inner: inner, left: left, right: right)) end