You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for documenting this! I would be glad to help out if I can figure out how. If you have any time and is convenient for you, can you point me to where I can begin?
I guess you can look at existing commits to see how. This one might be a good start: 00adcae
The trickiest bit is figuring out the structure of the resulting syntax tree. For CREATE TYPE I guess it should be something like:
exportinterfaceCreateTypeStmtextendsBaseNode{type: "create_type_stmt";createKw: Keyword<"CREATE">;typeKw: Keyword<"TYPE">;name: EntityName;// ENUM definition is probably the simplest, though others should fit here as welldefinition?: AsClause<EnumTypeDefinition>;}exportinterfaceEnumTypeDefinitionextendsBaseNode{type: "enum_type_definition";enumKw: Keyword<"ENUM">;values: ParenExpr<ListExpr<StringLiteral>>;}
Domains
name [AS] data_type
COLLATE collation
DEFAULT expression
domain_constraint [ ... ]
:CONSTRAINT constraint_name
NOT NULL
NULL
CHECK (expression)
IF EXISTS
name, ...
CASCADE | RESTRICT
SET DEFAULT expression | DROP DEFAULT
{ SET | DROP } NOT NULL
ADD domain_constraint
CONSTRAINT name
CHECK (...)
NOT NULL
[ NOT VALID ]
DROP CONSTRAINT [ IF EXISTS ] constraint_name [ RESTRICT | CASCADE ]
RENAME CONSTRAINT constraint_name TO new_constraint_name
VALIDATE CONSTRAINT constraint_name
OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
RENAME TO new_name
SET SCHEMA new_schema
Types
AS ( attribute_name data_type [ COLLATE collation ] [, ... ] )
AS ENUM ( 'label' [, ... ] )
AS RANGE ( ... )
:SUBTYPE = subtype
SUBTYPE_OPCLASS = subtype_operator_class
COLLATION = collation
CANONICAL = canonical_function
SUBTYPE_DIFF = subtype_diff_function
MULTIRANGE_TYPE_NAME = multirange_type_name
( ... )
:INPUT = input_function
OUTPUT = output_function
RECEIVE = receive_function
SEND = send_function
TYPMOD_IN = type_modifier_input_function
TYPMOD_OUT = type_modifier_output_function
ANALYZE = analyze_function
SUBSCRIPT = subscript_function
INTERNALLENGTH = { internallength | VARIABLE }
PASSEDBYVALUE
ALIGNMENT = alignment
STORAGE = storage
LIKE = like_type
CATEGORY = category
PREFERRED = preferred
ELEMENT = element
DELIMITER = delimiter
COLLATABLE = collatable
CREATE TYPE name;
IF EXISTS
name, ...
CASCADE | RESTRICT
OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
RENAME TO new_name
SET SCHEMA new_schema
RENAME ATTRIBUTE attribute_name TO new_attribute_name
CASCADE | RESTRICT
action, ...
:ADD ATTRIBUTE attribute_name data_type
COLLATE collation
CASCADE | RESTRICT
DROP ATTRIBUTE attribute_name
IF EXISTS
CASCADE | RESTRICT
ALTER ATTRIBUTE attribute_name
[ SET DATA ] TYPE data_type
COLLATE collation
CASCADE | RESTRICT
ADD VALUE new_enum_value
IF NOT EXISTS
{ BEFORE | AFTER } neighbor_enum_value
RENAME VALUE existing_enum_value TO new_enum_value
SET ( property = value [, ... ] )
The text was updated successfully, but these errors were encountered: