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

How to define foreign keys? #52

Open
eko234 opened this issue May 31, 2021 · 3 comments
Open

How to define foreign keys? #52

eko234 opened this issue May 31, 2021 · 3 comments

Comments

@eko234
Copy link

eko234 commented May 31, 2021

Hi, I'm looking for a way to define a foreign key constraint in my schemas, is there a way to do it or is out of the scope of this project?

@Bogdanp
Copy link
Owner

Bogdanp commented Jun 1, 2021

It depends on what you'd like the constraints to do. I'd say constraints to enable things like lazy loading/automatic relationships are out of scope, but if you're just looking to declare constraints such that create-table! can use them, I think those could be worth adding.

@eko234
Copy link
Author

eko234 commented Jun 1, 2021

Yes I think users would find it very useful, another thing I just found out was that it is not possible to declare multiple primary keys when defining a schema, which is another common use case, using deta has been pretty cool so far, I thank you so much for your work, using it in production right now :).

@corpix
Copy link

corpix commented Jul 28, 2023

@eko234 In #59 I've added ability to emit constraints section of the create table statement (after table columns). So, this may become possible :)

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

No branches or pull requests

3 participants