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

Are checks constraints supported? #1727

Open
ricardo8990 opened this issue Jul 3, 2023 · 1 comment
Open

Are checks constraints supported? #1727

ricardo8990 opened this issue Jul 3, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ricardo8990
Copy link

ricardo8990 commented Jul 3, 2023

What would you like to be added or enhanced

I haven't try it yet, but I can't find in the docs if CHECK CONSTRAINT is supported.

Why is this needed

Suppose I want to have a table to validate that a certain field is always bigger than 0. For instance an account model where the balance should always be bigger or equal 0. Is it something like this supported?

CREATE TABLE IF NOT EXISTS accounts (
    id INTEGER,
    name VARCHAR(100),
    balance INTEGER
    CHECK (balance >= 0)
);

Thanks in advance

@ricardo8990 ricardo8990 added the enhancement New feature or request label Jul 3, 2023
@jeroiraz
Copy link
Contributor

jeroiraz commented Jul 3, 2023

What would you like to be added or enhanced

I haven't try it yet, but I can't find in the docs if CHECK CONSTRAINT is supported.

Why is this needed

Suppose I want to have a table to validate that a certain field is always bigger than 0. For instance an account model where the balance should always be bigger or equal 0. Is it something like this supported?


CREATE TABLE IF NOT EXISTS accounts (

    id INTEGER,

    name VARCHAR(100),

    balance INTEGER

    CHECK (balance >= 0)

);

Thanks in advance

Hi @ricardo8990, thanks for reaching out. Constraint checking are not yet implemented but it could be added.

Would you mind opening a feature request for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants