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

Add PRIMARY KEY support #13

Closed
1 of 4 tasks
Bardin08 opened this issue Apr 16, 2024 · 0 comments · Fixed by #1 or #16
Closed
1 of 4 tasks

Add PRIMARY KEY support #13

Bardin08 opened this issue Apr 16, 2024 · 0 comments · Fixed by #1 or #16
Milestone

Comments

@Bardin08
Copy link
Owner

Bardin08 commented Apr 16, 2024

Description

Implement PRIMARY KEY support at the parser's side and the schema builder.

PRIMARY KEY can be found in a couple of positions.

-- Valid PRIMARY KEY Definitions

-- 1: Definition as a column constraint
CREATE TABLE users
(
    id         INT AUTO_INCREMENT PRIMARY KEY,
    name       VARCHAR(122) NOT NULL UNIQUE,
    profile_id INT
);

-- 2: Definition as a PRIMARY KEY attribute
CREATE TABLE users
(
    id         INT AUTO_INCREMENT,
    name       VARCHAR(122) NOT NULL UNIQUE,
    profile_id INT,
    PRIMARY KEY (id)
);

-- 3: Definition as a CONSTRAINT attribute
CREATE TABLE users
(
    id         INT AUTO_INCREMENT,
    name       VARCHAR(122) NOT NULL UNIQUE,
    profile_id INT,
    CONSTRAINT PR_User PRIMARY KEY (id)
);

ACC:

  • Simple PRIMARY KEY definitions
    • 1: Definition as a column constraint
    • 2: Definition as a PRIMARY KEY attribute
    • 3: Definition as a CONSTRAINT attribute
@Bardin08 Bardin08 added this to the v0.1.0 milestone Apr 16, 2024
@Bardin08 Bardin08 linked a pull request Apr 16, 2024 that will close this issue
@Bardin08 Bardin08 linked a pull request Apr 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant