fukamachi / sxql

An SQL generator for Common Lisp.
BSD 3-Clause "New" or "Revised" License
363 stars 31 forks source link

create index using syntax differs between mysql and postgresql #41

Open slyrus opened 7 years ago

slyrus commented 7 years ago

In postgres, one wants to write:

CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ name ] ON table [ USING method ] ...

whereas mysql wants:

CREATE [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name
    [index_type]
    ON tbl_name (index_col_name,...)
    [index_option]
    [algorithm_option | lock_option] ...

index_col_name:
    col_name [(length)] [ASC | DESC]

index_option:
    KEY_BLOCK_SIZE [=] value
  | index_type
  | WITH PARSER parser_name
  | COMMENT 'string'

index_type:
    USING {BTREE | HASH}
...

is there a good way to handle different output for different SQL dialects?