Sha256: 9c55bed6675bc98d81c7dff7bf4141f8f9fb11eebe9dfd43d1d3a6d0c11f4f73

Contents?: true

Size: 1.07 KB

Versions: 16

Compression:

Stored size: 1.07 KB

Contents

grammar SQLDelete
  include SQLRowSupport
  include SQLWhereCondition
  include SQLOrderByClause
  include SQLLimit
  include SQLHelpers

  rule delete
    single_table_delete
  end

  rule single_table_delete
    common_delete_clause
    table_name
    where_condition_or_empty
    order_by_condition_or_empty
    limit_condition_or_empty {
      def eval
        DeleteStatement.new(
          table_name.eval, 
          where_condition_or_empty.eval, 
          order_by_condition_or_empty.eval, 
          limit_condition_or_empty.eval
        )
      end
    }
  end

  rule common_delete_clause
    "DELETE" SPACE
    optional_delete_directives
    "FROM" SPACE
  end

  rule optional_delete_directives
    optional_low_priority
    optional_quick
    optional_ignore
  end

  rule optional_low_priority
    low_priority / EMPTY_STRING
  end

  rule optional_quick
    quick / EMPTY_STRING
  end

  rule optional_ignore
    ignore / EMPTY_STRING
  end

  rule ignore
    "IGNORE" SPACE
  end

  rule quick
    "QUICK" SPACE
  end

  rule low_priority
    "LOW_PRIORITY" SPACE
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
hipster_sql_to_hbase-0.3.29 lib/sql_parser/sql_delete.treetop
hipster_sql_to_hbase-0.3.20 lib/sql_parser/sql_delete.treetop
hipster_sql_to_hbase-0.3.12 lib/sql_parser/sql_delete.treetop
hipster_sql_to_hbase-0.3.2 lib/sql_parser/sql_delete.treetop
hipster_sql_to_hbase-0.3.1 lib/sql_parser/sql_delete.treetop
hipster_sql_to_hbase-0.3.0 lib/sql_parser/sql_delete.treetop
hipster_sql_to_hbase-0.2.2 lib/sql_parser/sql_delete.treetop
hipster_sql_to_hbase-0.2.0 lib/sql_parser/sql_delete.treetop
hipster_sql_to_hbase-0.1.85 lib/sql_parser/sql_delete.treetop
hipster_sql_to_hbase-0.1.8 lib/sql_parser/sql_delete.treetop
hipster_sql_to_hbase-0.1.7 lib/sql_parser/sql_delete.treetop
hipster_sql_to_hbase-0.1.6 lib/sql_parser/sql_delete.treetop
hipster_sql_to_hbase-0.1.5 lib/sql_parser/sql_delete.treetop
hipster_sql_to_hbase-0.1.4 lib/sql_parser/sql_delete.treetop
hipster_sql_to_hbase-0.1.3 lib/sql_parser/sql_delete.treetop
hipster_sql_to_hbase-0.1.2 lib/sql_parser/sql_delete.treetop