Module: Ronin::Code::SQL::Statements
- Included in:
- Clause, InjectionExpr, StatementList
- Defined in:
- lib/ronin/code/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.
98 99 100 |
# File 'lib/ronin/code/sql/statements.rb', line 98 def delete(table,&block) statement([:DELETE, :FROM],table,&block) end |
#drop_table(table, &block) ⇒ Statement
Creates a new DROP TABLE
statement.
111 112 113 |
# File 'lib/ronin/code/sql/statements.rb', line 111 def drop_table(table,&block) statement([:DROP, :TABLE],table,&block) end |
#insert(&block) ⇒ Statement
Creates a new INSERT
statement.
72 73 74 |
# File 'lib/ronin/code/sql/statements.rb', line 72 def insert(&block) statement(:INSERT,&block) end |
#select(*columns, &block) ⇒ Statement
Creates a new SELECT
statement.
62 63 64 |
# File 'lib/ronin/code/sql/statements.rb', line 62 def select(*columns,&block) statement(:SELECT,columns,&block) end |
#statement(keyword, argument = nil) {|(statement)| ... } ⇒ Statement
Creates an arbitrary statement.
49 50 51 |
# File 'lib/ronin/code/sql/statements.rb', line 49 def statement(keyword,argument=nil,&block) Statement.new(keyword,argument,&block) end |
#update(table, &block) ⇒ Statement
Creates a new UPDATE
statement.
85 86 87 |
# File 'lib/ronin/code/sql/statements.rb', line 85 def update(table,&block) statement(:UPDATE,table,&block) end |