Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser: Implement basic CREATE TABLE DDL #58

Open
KieranKaelin opened this issue Mar 1, 2023 · 0 comments
Open

Parser: Implement basic CREATE TABLE DDL #58

KieranKaelin opened this issue Mar 1, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request parser Parser functionality

Comments

@KieranKaelin
Copy link
Contributor

In order to be able to succeed the ANTLR4 parser used in the Atroposs DMA Module, the parser must be able to understand DDL. This is the first of many issues marking the way to replacing said parser.

Goal

A basic CREATE TABLE statement shall produce an appropriate AST.

For reference, see the Oracle documentation.

Examples

-- SQL Developer Export
CREATE TABLE "MY_SCHEMA"."EMP" (
  "EMP_ID" NUMBER(6,0) DEFAULT MY_SCEHMA.EMP_SEQ.nextval,
  "CREATED_AT" TIMESTAMP WITH TIME ZONE,
  "EMAIL" VARCHAR2(25 BYTE)
 )
SEGMENT CREATION IMMEDIATE
ORGANIZATION INDEX NOCOMPRESS PCTFREE 10 INITRANS 2 MAXTRANS 255 LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 MAXSIZE UNLIMITED FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSAUX"
PCTTHRESHOLD 50;

How to demo

Appropriate tests are created showcasing the resulting AST and AST accessors to iterate and inspect the table properties.

Non-goals

  • Constraints: The SQL Developer exports them in separate DDL statements, never as inline constraints
  • Identity columns: Share syntax with sequences, and may be implemented in parallel
  • Partitions: Implemented as part of another ticket due to their complexity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request parser Parser functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant