coresql / sql-query-identifier

A SQL query identifier (e.g. INSERT, SELECT, CREATE TABLE, and etc.)
https://sqlectron.github.io/sql-query-identifier/
MIT License
33 stars 10 forks source link

Add support for schema statements #36

Closed MasterOdin closed 3 years ago

MasterOdin commented 3 years ago

These statement types are missing.

MasterOdin commented 3 years ago

@rathboma For mysql, the above statements are all aliases for DATABASE, e.g. CREATE SCHEMA is an alias for CREATE DATABASE. Given the mysql dialect, should we then return CREATE_DATABASE instead of CREATE_SCHEMA given that CREATE_SCHEMA is not equivalent to what the statement type means in other DBs given the usual tree based structure for displaying a given DB server.

rathboma commented 3 years ago

I think that could be more confusing honestly so I'd probably just do the naive thing.

I think mostly folks will be looking out for the type of statement rather than the explicit type anyway.