Module: Ronin::SQL::Statements
- Included in:
- Clause, InjectionExpr, StatementList
- Defined in:
- lib/ronin/sql/statements.rb
Overview
Methods for creating common SQL Statements.
Instance Method Summary collapse
-
#delete(table, &block) ⇒ Statement
Creates a new
DELETE
statement. -
#drop_table(table, &block) ⇒ Statement
Creates a new
DROP TABLE
statement. -
#insert(&block) ⇒ Statement
Creates a new
INSERT
statement. -
#select(*columns, &block) ⇒ Statement
Creates a new
SELECT
statement. -
#statement(keyword, argument = nil) {|(statement)| ... } ⇒ Statement
Creates an arbitrary statement.
-
#update(table, &block) ⇒ Statement
Creates a new
UPDATE
statement.
Instance Method Details
#delete(table, &block) ⇒ Statement
Creates a new DELETE
statement.
99 100 101 |
# File 'lib/ronin/sql/statements.rb', line 99 def delete(table,&block) statement([:DELETE, :FROM],table,&block) end |
#drop_table(table, &block) ⇒ Statement
Creates a new DROP TABLE
statement.
112 113 114 |
# File 'lib/ronin/sql/statements.rb', line 112 def drop_table(table,&block) statement([:DROP, :TABLE],table,&block) end |
#insert(&block) ⇒ Statement
Creates a new INSERT
statement.
73 74 75 |
# File 'lib/ronin/sql/statements.rb', line 73 def insert(&block) statement(:INSERT,&block) end |
#select(*columns, &block) ⇒ Statement
Creates a new SELECT
statement.
63 64 65 |
# File 'lib/ronin/sql/statements.rb', line 63 def select(*columns,&block) statement(:SELECT,columns,&block) end |
#statement(keyword, argument = nil) {|(statement)| ... } ⇒ Statement
Creates an arbitrary statement.
50 51 52 |
# File 'lib/ronin/sql/statements.rb', line 50 def statement(keyword,argument=nil,&block) Statement.new(keyword,argument,&block) end |
#update(table, &block) ⇒ Statement
Creates a new UPDATE
statement.
86 87 88 |
# File 'lib/ronin/sql/statements.rb', line 86 def update(table,&block) statement(:UPDATE,table,&block) end |