Skip to content

[5pt] Constraints #2627

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

Closed
2 tasks
Tracked by #2606
art-dr opened this issue Jan 25, 2022 · 3 comments · Fixed by #2943
Closed
2 tasks
Tracked by #2606

[5pt] Constraints #2627

art-dr opened this issue Jan 25, 2022 · 3 comments · Fixed by #2943
Assignees
Labels
feature A new functionality reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality

Comments

@art-dr
Copy link
Contributor

art-dr commented Jan 25, 2022

Related dev. issue(s): tarantool/tarantool#6436

Product: Tarantool
Since: 2.10.0
SME: @ alyapunov

Details

https://docs.google.com/document/d/1EtqfFSIMi6fDqj2y-9WgpunkHsszU65p6LfNly5E9Ag/

Space constraints are needed to ensure that tuples in a space satisfy the specified conditions. Normal constraints define a function that defines the correctness of a tuple. Foreign keys describe the relationship between tables by requiring an external tuple in another spacer with specific fields.

The usual constraints are set for a tuple field or the entire tuple and refer by name to a function from space _func. To be safe for now, it's made to be a Lua function, with the body text right in the _func space.

Constraints for fields work much faster, constraints for tuples are much more versatile.

Definition of done

  • describe how constraints for fields work
  • describe how constraints for tuples work
@art-dr art-dr added feature A new functionality reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality sql [location] SQL manual labels Jan 25, 2022
This was referenced Jan 25, 2022
@pgulutzan
Copy link
Contributor

@arctic-dreamer: Why is there an sql label? Tarantool issue 6436 appears to be a Lua issue.

@p7nov p7nov self-assigned this Jun 10, 2022
@p7nov p7nov removed the sql [location] SQL manual label Jun 17, 2022
@patiencedaur patiencedaur added 3sp and removed 5sp labels Jun 22, 2022
p7nov added a commit that referenced this issue Jun 24, 2022
Resolves #2627

Co-authored-by: Dia Patience Daur <[email protected]>
@Totktonada
Copy link
Member

I see nothing about constraints in the API description: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_schema/space_create/. It is nice to have guides, but an API reference is more important.

@Totktonada Totktonada reopened this Feb 28, 2023
@p7nov
Copy link
Contributor

p7nov commented Mar 1, 2023

I see nothing about constraints in the API description: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_schema/space_create/. It is nice to have guides, but an API reference is more important.

You're right, the reference somehow slipped out of this task's scope. And the same for foreign keys (#2628). Thanks for noting this.
However, I think a new issue will be easier to plan and track. I'll file it and link to this one.

@p7nov p7nov closed this as completed Mar 1, 2023
This was referenced Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants