Section 11 in Foundation This module covers the tests for parsing schema and DDL statements. > module Language.SQL.SimpleSQL.SQL2011Schema (sql2011SchemaTests) where > import Language.SQL.SimpleSQL.TestTypes > import Language.SQL.SimpleSQL.Syntax > sql2011SchemaTests :: TestItem > sql2011SchemaTests = Group "sql 2011 schema tests" > [ 11.1 ::= CREATE SCHEMA [ ] [ ... ] > (TestStatement SQL2011 "create schema my_schema" > $ CreateSchema [Name "my_schema"]) todo: schema name can have . schema name can be quoted iden or unicode quoted iden ::= | | | ::= | AUTHORIZATION | AUTHORIZATION ::= ::= DEFAULT CHARACTER SET ::= ::= | | | | | | | | | | | | | | | 11.2 ::= DROP SCHEMA ::= CASCADE | RESTRICT > ,(TestStatement SQL2011 "drop schema my_schema" > $ DropSchema [Name "my_schema"] DefaultDropBehaviour) > ,(TestStatement SQL2011 "drop schema my_schema cascade" > $ DropSchema [Name "my_schema"] Cascade) > ,(TestStatement SQL2011 "drop schema my_schema restrict" > $ DropSchema [Name "my_schema"] Restrict) 11.3
::= CREATE [
] TABLE
[ WITH ] [ ON COMMIT
ROWS ] ,(TestStatement SQL2011 "create table ( a int )"
::=
| |
::= TEMPORARY ::= GLOBAL | LOCAL ::= SYSTEM VERSIONING
::= PRESERVE | DELETE
::=
[ {
}... ]
::= |
|
| ::= OF [ ] [ ] ::= [ { }... ] ::= |
| ::= REF IS [ ] ::= SYSTEM GENERATED | USER GENERATED | DERIVED ::= ::= WITH OPTIONS ::= [ ] [ ] [ ... ] ::= UNDER ::= ::=
::= LIKE
[ ] ::= ... ::= | | ::= INCLUDING IDENTITY | EXCLUDING IDENTITY ::= INCLUDING DEFAULTS | EXCLUDING DEFAULTS ::= INCLUDING GENERATED | EXCLUDING GENERATED ::= [ ] AS
::= WITH NO DATA | WITH DATA
::= ::= | ::= PERIOD FOR SYSTEM_TIME ::= PERIOD FOR ::= ::= ::= 11.4 ::= [ ] [ | | | | ] [ ... ] [ ] ::= | ::= AS ROW START ::= AS ROW END ::= GENERATED ALWAYS ::= [ ] [ ] ::= NOT NULL | | | ::= GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY [ ] ::= AS ::= GENERATED ALWAYS ::= 11.5 ::= DEFAULT ::= | | USER | CURRENT_USER | CURRENT_ROLE | SESSION_USER | SYSTEM_USER | CURRENT_CATALOG | CURRENT_SCHEMA | CURRENT_PATH | 11.6
::= [ ]
[ ]
::= | | 11.7 ::= [ ] | UNIQUE ( VALUE ) ::= UNIQUE | PRIMARY KEY ::= ::= WITHOUT OVERLAPS 11.8 ::= FOREIGN KEY [ ] ::= REFERENCES [ MATCH ] [ ] ::= FULL | PARTIAL | SIMPLE ::= ::= PERIOD ::=
[ [ ] ] ::= ::= PERIOD ::= [ ] | [ ] ::= ON UPDATE ::= ON DELETE ::= CASCADE | SET NULL | SET DEFAULT | RESTRICT | NO ACTION 11.9 ::= CHECK 11.10 ::= ALTER TABLE
::= | | | | | | | | | 11.11 ::= ADD [ COLUMN ] 11.12 ::= ALTER [ COLUMN ] ::= | | | | | | | | | 11.13 ::= SET 11.14 ::= DROP DEFAULT 11.15 ::= SET NOT NULL 11.16 ::= DROP NOT NULL 11.17 ::= ADD 11.18 ::= DROP SCOPE 11.19 ::= SET DATA TYPE 11.20 ::= [ ... ] | ... ::= SET GENERATED { ALWAYS | BY DEFAULT } ::= | SET 11.21 ::= DROP IDENTITY 11.22 ::= DROP EXPRESSION 11.23 ::= DROP [ COLUMN ] 11.24 ::= ADD
11.25 ::= ALTER CONSTRAINT 11.26 ::= DROP CONSTRAINT 11.27 ::= ADD
[ ] ::= ADD [ COLUMN ] ADD [ COLUMN ] ::= ::= 11.28 ::= DROP 11.29 ::= ADD 11.30 ::= DROP SYSTEM VERSIONING 11.31 ::= DROP TABLE
11.32 ::= CREATE [ RECURSIVE ] VIEW
AS [ WITH [ ] CHECK OPTION ] ::= | ::= [ ] ::= OF [ ] [ ] ::= UNDER
::= [ { }... ] ::= | ::= WITH OPTIONS ::= CASCADED | LOCAL ::= 11.33 ::= DROP VIEW
11.34 ::= CREATE DOMAIN [ AS ] [ ] [ ... ] [ ] ::= [ ] [ ] 11.35 ::= ALTER DOMAIN ::= | | | 11.36 ::= SET 11.37 ::= DROP DEFAULT 11.38 ::= ADD 11.39 ::= DROP CONSTRAINT 11.40 ::= DROP DOMAIN 11.41 ::= CREATE CHARACTER SET [ AS ] [ ] ::= GET 11.42 ::= DROP CHARACTER SET 11.43 ::= CREATE COLLATION FOR FROM [ ] ::= ::= NO PAD | PAD SPACE 11.44 ::= DROP COLLATION 11.45 ::= CREATE TRANSLATION FOR TO FROM ::= ::= ::= | ::= ::= 11.46 ::= DROP TRANSLATION 11.47 ::= CREATE ASSERTION CHECK [ ] 11.48 ::= DROP ASSERTION [ ] 11.49 ::= CREATE TRIGGER ON
[ REFERENCING ] ::= BEFORE | AFTER | INSTEAD OF ::= INSERT | DELETE | UPDATE [ OF ] ::= ::= [ FOR EACH { ROW | STATEMENT } ] [ ] ::= WHEN ::= | BEGIN ATOMIC { }... END ::= ... ::= OLD [ ROW ] [ AS ] | NEW [ ROW ] [ AS ] | OLD TABLE [ AS ] | NEW TABLE [ AS ] ::= ::= ::= ::= ::= 11.50 ::= DROP TRIGGER 11.51 ::= CREATE TYPE ::= [ ] [ AS ] [ ] [ ] ::= [ ... ] ::= | | | | | | ::= UNDER ::= ::= | | ::= [ { }... ] ::= ::= INSTANTIABLE | NOT INSTANTIABLE ::= FINAL | NOT FINAL ::= | | ::= REF USING ::= REF FROM ::= REF IS SYSTEM GENERATED ::= CAST SOURCE AS REF WITH ::= ::= CAST REF AS SOURCE WITH ::= ::= [ { }... ] ::= CAST SOURCE AS DISTINCT WITH ::= ::= CAST DISTINCT AS SOURCE WITH ::= ::= [ { }... ] ::= | ::= [ SELF AS RESULT ] [ SELF AS LOCATOR ] [ ] ::= OVERRIDING 1 ::= [ INSTANCE | STATIC | CONSTRUCTOR ] METHOD [ SPECIFIC ] ::= [ ] ::= ... ::= | | | | 11.52 ::= [ ] [ ] ::= 11.53 ::= ALTER TYPE ::= | | | | 11.54 ::= ADD ATTRIBUTE 11.55 ::= DROP ATTRIBUTE RESTRICT 11.56 ::= ADD 11.57 ::= ADD 11.58 ::= DROP RESTRICT ::= [ INSTANCE | STATIC | CONSTRUCTOR ] METHOD 11.59 ::= DROP TYPE 11.60 ::= ::= | ::= CREATE ::= CREATE ::= PROCEDURE ::= { | } ::= [ [ { }... ] ] ::= [ ] [ ] [ RESULT ] [ DEFAULT ] ::= | ::= IN | OUT | INOUT ::= [ ] ::= AS LOCATOR ::= FUNCTION [ ] ::= SPECIFIC METHOD | [ INSTANCE | STATIC | CONSTRUCTOR ] METHOD [ ] FOR ::= [ ... ] ::= | | SPECIFIC | | | | | ::= NEW SAVEPOINT LEVEL | OLD SAVEPOINT LEVEL ::= DYNAMIC RESULT SETS ::= PARAMETER STYLE ::= STATIC DISPATCH ::= RETURNS ::= [ ] | ::= TABLE
::=
[ {
}... ]
::= ::= CAST FROM ::= [ ] ::= [ ] ::= | ::= [ ] ::= SQL SECURITY INVOKER | SQL SECURITY DEFINER ::= ::= EXTERNAL [ NAME ] [ ] [ ] [ ] ::= EXTERNAL SECURITY DEFINER | EXTERNAL SECURITY INVOKER | EXTERNAL SECURITY IMPLEMENTATION DEFINED ::= SQL | GENERAL ::= DETERMINISTIC | NOT DETERMINISTIC ::= NO SQL | CONTAINS SQL | READS SQL DATA | MODIFIES SQL DATA ::= RETURNS NULL ON NULL INPUT | CALLED ON NULL INPUT ::= ::= TRANSFORM GROUP { | } ::= ::= [ { }... ] ::= FOR TYPE 11.61 ::= ALTER ::= ... ::= | | | | | NAME ::= RESTRICT 11.62 ::= DROP 11.63 ::= CREATE CAST AS WITH [ AS ASSIGNMENT ] ::= ::= ::= 11.64 ::= DROP CAST AS 11.65 ::= CREATE ORDERING FOR ::= | ::= EQUALS ONLY BY ::= ORDER FULL BY ::= | | ::= RELATIVE WITH ::= MAP WITH ::= STATE [ ] ::= ::= 11.66 ::= DROP ORDERING FOR 11.67 ::= CREATE { TRANSFORM | TRANSFORMS } FOR ... ::= ::= ::= [ ] ::= | ::= TO SQL WITH ::= FROM SQL WITH ::= ::= 11.68 ::= ALTER { TRANSFORM | TRANSFORMS } FOR ... ::= ::= [ { }... ] ::= | 11.69 ::= ADD 11.70 ::= DROP [ ] ::= TO SQL | FROM SQL 11.71 ::= DROP { TRANSFORM | TRANSFORMS } FOR ::= ALL | ::= 11.72 ::= CREATE SEQUENCE [ ] ::= ... ::= | ::= ... ::= | ::= | | | ::= AS ::= START WITH ::= ::= INCREMENT BY ::= ::= MAXVALUE | NO MAXVALUE ::= ::= MINVALUE | NO MINVALUE ::= ::= CYCLE | NO CYCLE 11.73 ::= ALTER SEQUENCE ::= ... ::= | ::= RESTART [ WITH ] ::= 11.74 ::= DROP SEQUENCE > ]