export const keywordHelpers = {
  Distinct: ['Distinct([ROW_CALL], field=<INT_FIELD>, [index=<INDEX_NAME>])'],
  Row: [
    'Row(<FIELD>=<ROW>)',
    'Row(<FIELD>=<ROW>, from=<TIMESTAMP>, to=<TIMESTAMP>)',
    'Row([<COMPARISON_VALUE> <COMPARISON_OPERATOR>] <FIELD> <COMPARISON_OPERATOR> <COMPARISON_VALUE>)'
  ],
  Union: ['Union([ROW_CALL ...])'],
  Intersect: ['Intersect(<ROW_CALL>, [ROW_CALL ...])'],
  Difference: ['Difference(<ROW_CALL>, [ROW_CALL ...])'],
  Xor: ['Xor(<ROW_CALL>, [ROW_CALL ...])'],
  Not: ['Not(<ROW_CALL>'],
  Count: ['Count(<ROW_CALL>)'],
  Shift: ['Shift(<ROW_CALL>, [n=UINT])'],
  TopK: ['TopK(<FIELD>, [k=UINT], [filter=ROW_CALL], [from=TIMESTAMP], [to=TIMESTAMP])'],
  TopN: [
    'TopN(<FIELD>, [ROW_CALL], [n=UINT], [attrName=<ATTR_NAME>, attrValues=<[]ATTR_VALUE>])'
  ],
  Min: ['Min([ROW_CALL], field=<FIELD>)'],
  Max: ['Max([ROW_CALL], field=<FIELD>)'],
  Sum: ['Sum([ROW_CALL], field=<FIELD>)'],
  Rows:
    ['Rows(<FIELD>, previous=<UINT|STRING>, limit=<UINT>, column=<UINT|STRING>, from=<TIMESTAMP>, to=<TIMESTAMP>)'],
  GroupBy: ['GroupBy(<ROWS_CALL>, [<ROWS_CALL>...], limit=<UINT>, filter=<ROW_CALL>, having=Condition([<COMPARISON_VALUE> <COMPARISON_OPERATOR>] <count|sum> <COMPARISON_OPERATOR> <COMPARISON_VALUE>), aggregate=<CALL>, sort=<SORT_DIRECTIVE_LIST>)'],
  Extract: ['Extract(<ROW_CALL>, [<ROWS_CALL>...])'],
  Limit: ['Limit(<ROW_CALL>, [limit=<UINT>], [offset=<UINT>])'],
  Set: ['Set(<COLUMN>, <FIELD>=<ROW>, [TIMESTAMP])'],
  SetColumnAttrs: ['SetColumnAttrs(<COLUMN>, <ATTR_NAME=ATTR_VALUE>, [ATTR_NAME=ATTR_VALUE ...])'],
  SetRowAttrs: ['SetRowAttrs(<FIELD>, <ROW>, <ATTR_NAME=ATTR_VALUE>, [ATTR_NAME=ATTR_VALUE ...])'],
  Store: ['Store(<ROW_CALL>, <FIELD>=<ROW>)'],
  ClearRow: ['ClearRow(<FIELD>=<ROW>)'],
  Clear: ['Clear(<COLUMN>, <FIELD>=<ROW>)'],
  Options: ['Options(<CALL>, columnAttrs=<BOOL>, excludeColumns=<BOOL>, excludeRowAttrs=<BOOL>, shards=[UINT ...])'],
  IncludesColumn: ['IncludesColumn(<ROW_CALL>, column=<UINT|STRING>)'],
  select: [
    'select * from <TABLE> where _id = 1',
    'select <FIELD>, <FIELD> from <TABLE>',
    'select _id, <FIELD> from <TABLE> where _id = <_ID>',
    'select _id from <TABLE>',
    'select distinct <FIELD> from <TABLE>',
    'select count(',
    'select min(<FIELD>) from <TABLE>',
    'select max(<FIELD>) from <TABLE>',
    'select sum(<FIELD>) from <TABLE>',
    'select avg(<FIELD>) from <TABLE>',
  ],
  'select * from': [
    'select * from <TABLE> where _id = 1',
    'select <FIELD>, <FIELD> from <TABLE>',
    'select _id, <FIELD> from <TABLE> where _id = <_ID>',
    'select _id from <TABLE>',
    'select distinct <FIELD> from <TABLE>',
    'select count(',
    'select min(<FIELD>) from <TABLE>',
    'select max(<FIELD>) from <TABLE>',
    'select sum(<FIELD>) from <TABLE>',
    'select avg(<FIELD>) from <TABLE>',
  ],
  'select _id from': [
    'select _id from <TABLE> where <FIELD> = 1',
    'select _id from <TABLE> where <FIELD> in (1, 2)',
    'select _id from <TABLE> where <FIELD> = 1 limit 1',
    'select _id from <TABLE> where <FIELD> = 1 and <FIELD> = 2',
  ],
  'select count(': [
    'select count(*) from <TABLE>',
    'select count(*) from <TABLE> where <FIELD> = 1',
    'select count(*) from <TABLE> where <FIELD> = 1 and <FIELD> = 2',
    'select count(distinct <FIELD>) from <TABLE>',
  ],
  'select distinct': ['select distinct <FIELD> from <TABLE>'],
  'select avg(': [
    'select avg(<FIELD>) from <TABLE>',
    'select avg(<FIELD>) from <TABLE> where <FIELD> = 1',
  ],
  'select min(': [
    'select min(<FIELD>) from <TABLE>',
    'select min(<FIELD>) from <TABLE> where <FIELD> = 1',
  ],
  'select max(': [
    'select max(<FIELD>) from <TABLE>',
    'select max(<FIELD>) from <TABLE> where <FIELD> = 1',
  ],
  'select sum(': [
    'select sum(<FIELD>) from <TABLE>',
    'select sum(<FIELD>) from <TABLE> where <FIELD> = 1',
  ],
  show: ['show tables', 'show fields from <TABLE>'],
  'show tables': ['show tables', 'show fields from <TABLE>'],
  'show fields from': ['show tables', 'show fields from <TABLE>'],
};

export const rowCallOptions = [
  'All()',
  'ConstRow(',
  'Difference(',
  'Intersect(',
  'Limit(',
  'Not(',
  'Row(',
  'Union(',
  'UnionRows(',
  'Xor('
];

export const pqlKeywords = [
  'All()',
  'Clear(',
  'ClearRow(',
  'ConstRow(columns=[',
  'Count(',
  'Difference(',
  'Distinct(',
  'Extract(',
  'GroupBy(',
  'IncludesColumn(',
  'Intersect(',
  'Limit(',
  'Max(',
  'Min(',
  'Not(',
  'Options(',
  'Row(',
  'Rows(',
  'Set(',
  'SetColumnAttrs(',
  'SetRowAttrs(',
  'Sum(',
  'Store(',
  'TopK(',
  'TopN(',
  'Union(',
  'UnionRows(',
  'Xor('
];

export const sqlKeywords = [
  'drop table ',
  'show ',
  'show tables ',
  'show fields from ',
  'select ',
  'select * from ',
  'select _id from ',
  'select count(',
  'select distinct ',
  'select avg(',
  'select max(',
  'select min(',
  'select sum('
];
