Sha256: 308f4df331b5b487d8f8ab8a6d1f73382a74b08640a9ebed09b9b292212e55ea

Contents?: true

Size: 1.81 KB

Versions: 5

Compression:

Stored size: 1.81 KB

Contents

rules:
  query:
    - with_exp
    - nonjoin_exp
  with_exp:
    - [ with_spec, nonjoin_exp ]
  with_spec:
    - [ name_intro+ ]
  name_intro:
    - [ table_name, nonjoin_exp ]
  nonjoin_exp:
    - union
    - except
    - intersect
    - select_exp
  union:
    - [ all, nonjoin_exp, nonjoin_exp ]
  all:
    - truth_value
  except:
    - [ set_quantifier, nonjoin_exp, nonjoin_exp ]
  intersect:
    - [ set_quantifier, nonjoin_exp, nonjoin_exp ]
  join_exp:
    - cross_join
    - inner_join
  cross_join:
    - [ table_spec, table_spec ]
  inner_join:
    - [ table_spec, table_spec, predicate ]
  using:
    - [ column_name+ ]
  select_exp:
    - [ set_quantifier,
        [ select_list, select_star ],
        from_clause,
        where_clause,
        order_by_clause,
        limit_clause,
        offset_clause ]
  set_quantifier:
    - [ set_quantifier_name ]
  select_star:
    - []
  set_quantifier_name:
    !ruby/regexp /^all|distinct$/
  select_list:
    - [ select_item+ ]
  from_clause:
    - [ table_spec ]
  where_clause:
    - [ predicate ]
  order_by_clause:
    - [ order_by_term+ ]
  order_by_term:
    - [ qualified_name, direction ]
  direction:
    !ruby/regexp /^asc|desc$/
  select_item:
    - [ scalar_exp, column_name ]
  table_spec:
    - table_as
    - subquery_as
    - join_exp
  table_as:
    - [ table_name, range_var_name ]
  subquery_as:
    - [ nonjoin_exp, range_var_name ]
  scalar_exp:
    - qualified_name
    - column_name
    - literal
  qualified_name:
    - [ range_var_name, column_name ]
  column_name:
    - [ name_rgx ]
  table_name:
    - [ name_rgx ]
  range_var_name:
    - [ name_rgx ]
  limit_clause:
    - [ integer ]
  offset_clause:
    - [ integer ]
  integer:
    - "::Integer"
  literal:
    - "::Object"
  name_rgx:
    !ruby/regexp /^[a-zA-Z0-9_]+$/
  truth_value:
    "::Alf::Boolean"

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
alf-sql-0.16.3 lib/alf/sql/grammar.sexp.yml
alf-sql-0.16.2 lib/alf/sql/grammar.sexp.yml
alf-sql-0.16.1 lib/alf/sql/grammar.sexp.yml
alf-sql-0.16.0 lib/alf/sql/grammar.sexp.yml
alf-sql-0.15.0 lib/alf/sql/grammar.sexp.yml