Class TapKit::SQLExpression
In: lib/tapkit/access/sql.rb
Parent: Object

Methods

Constants

NULL = 'NULL'
NAME_KEY = :name_key
PLACEHOLDER_KEY = :placeholder_key
ATTRIBUTE_KEY = :attribute_key
VALUE_KEY = :value_key
READ_FORMAT = '%P'
WRITE_FORMAT = '%V'

Attributes

aliases  [R] 
bind_variables  [R] 
encoding  [RW] 
entity  [R] 
group_by_string  [R] 
join_entities  [R] 
join_on  [R] 
join_relationships  [R] 
join_semantic  [R] 
list_string  [R] 
lock_clause  [R] 
order_by_string  [R] 
statement  [RW] 
use_aliases  [W] 
use_bind_variables  [W] 
value_list  [R] 
where_clause  [R] 

Public Class methods

Public Instance methods

SELECT group_by column_list FROM table_list join_semantic JOIN join_clause WHERE where_clause GROUP BY group_by HAVING having_clause ORDER BY order_clause

attributes, lock, qualifier, fetchorder are unsupported.

 SELECT column_list FROM table_list lock_clause
 join_semantic JOIN join_clause WHERE where_clause ORDER BY order_clause

abstract method. this is default implementation.

Generates a DELETE statement by the following steps:

  1. Generates where_clause.
  2. Invokes table_list to get the table name for the FROM clause..
  3. Invokes assemble_delete.

Generates a INSERT statement by the following steps:

  1. Invokes add_insert_list_attribute for each entry in row to prepare the comma-separated list of attributes and the corresponding list of values.
  2. Invokes table_list to get the tables name for the FROM clause.
  3. Invokes assemble_insert.

Generates a SELECT statement by the following steps:

  1. Invokes add_select_list() for each in the attributes.
  2. Uses qualifier of the fetch_spec to generate where_clause.
  3. Invokes add_order() for each AttributeOrdering object in the fetch_spec.
  4. Invokes join_expression() to generate join_clause.
  5. Invokes table_list() to generate FROM clause.
  6. If the lock is true, invokes lock_clause to get the SQL string for locking selected rows.
  7. Invokes assemble_select(). After this, you can get the complete SELECT statement by calling statement().

Generates a UPDATE statement by the following steps:

  1. Invokes add_update_list_attribute for each entry in row to prepare the comma-separated list of "attribute = value" assignments.
  2. Generates where_clause.
  3. Invokes table_list to get the table name for the FROM clause.
  4. Invokes assemble_update.

(<qualifier> AND <qualifier> AND … <qualifier>)

(<qualifier> OR <qualifier> OR … <qualifier>)

  • -> %

? -> _ % -> \% _ -> _ * -> * \? -> ?

[Validate]