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

Primary Key in column definition of entity #83

Open
ronic09 opened this issue Aug 10, 2021 · 3 comments
Open

Primary Key in column definition of entity #83

ronic09 opened this issue Aug 10, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ronic09
Copy link

ronic09 commented Aug 10, 2021

Hello! I am using cottontail for my master thesis. Thank you for your work!
It seems to me that the primary flag in the column definition of an entity has no effect.
It is possible to insert multiple entries with the same string ID into an entity with primary key set for the column.
Furthermore, the CLI command "entity about schema entity" does not list primary information for the columns.

Best,
Simon

@ppanopticon
Copy link
Member

Hey! Sorry for the late reply! Currently, the primary key flag indeed has no effect - it's merely a placeholder for a planned feature.

Best,
Ralph

@ronic09
Copy link
Author

ronic09 commented Aug 27, 2021

Hey Ralph, many thanks for your reply!

@ppanopticon ppanopticon added this to the 0.15.0 milestone Mar 7, 2022
@ppanopticon ppanopticon self-assigned this Mar 7, 2022
@ppanopticon ppanopticon added the enhancement New feature or request label Mar 7, 2022
@ppanopticon ppanopticon modified the milestones: 0.15.0, v0.16.0 Apr 11, 2022
@ppanopticon
Copy link
Member

ppanopticon commented Apr 26, 2022

Since as of version 0.15.0 of Cottontail DB, a column can already be decleared as primary key, I would suggest the following additions to finalise this feature request:

  • Marking a column as primary-key force-creates an index for that column, which cannot be dropped. Furthermore, primary-key columns cannot be null.
  • Upon INSERT, unique constraint of a value must be enforced using said index (which should already be the case, but needs to be handled properly).

Any thoughts on this?

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