lava-oushudb-dt-sql-parser/test/parser/mysql/syntax/fixtures/createDatabase.sql
琉易 428d851913
feat: #190 improve mysql grammer (#196)
* refactor: generic rename to mysql

* refactor: g4 with mysql syntax

* test: mysql syntax

* refactor: remove useless keywords

* refactor: remove nonReserved keywords

* refactor: lint specificFunction

---------

Co-authored-by: liuyi <liuyi@dtstack.com>
2023-11-27 15:25:40 +08:00

35 lines
1013 B
SQL

-- https://dev.mysql.com/doc/refman/8.0/en/create-database.html
/* CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name
[create_option] ...
create_option: [DEFAULT] {
CHARACTER SET [=] charset_name
| COLLATE [=] collation_name
| ENCRYPTION [=] {'Y' | 'N'}
} */
-- https://dev.mysql.com/doc/refman/5.7/en/create-database.html
/* CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name
[create_option] ...
create_option: [DEFAULT] {
CHARACTER SET [=] charset_name
| COLLATE [=] collation_name
} */
CREATE DATABASE IF NOT EXISTS db_name;
CREATE DATABASE db_name CHARACTER SET utf8mb4;
CREATE DATABASE db_name COLLATE utf8mb4_unicode_ci;
CREATE DATABASE db_name ENCRYPTION = 'Y';
CREATE DATABASE db_name DEFAULT ENCRYPTION 'N';
CREATE SCHEMA IF NOT EXISTS db_name DEFAULT ENCRYPTION 'Y';
CREATE SCHEMA db_name DEFAULT CHARACTER SET utf8mb4;
CREATE SCHEMA db_name DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE SCHEMA db_name DEFAULT ENCRYPTION = 'Y';
CREATE SCHEMA db_name DEFAULT ENCRYPTION 'N';