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 support for unique constraint #37

Open
SingingBush opened this issue Aug 29, 2016 · 3 comments
Open

add support for unique constraint #37

SingingBush opened this issue Aug 29, 2016 · 3 comments
Assignees

Comments

@SingingBush
Copy link
Collaborator

The @Column definition currently:

struct Column {
    immutable string name;
    immutable int length;
}

It would be great if there was a third parameter to mark a column as being unique:

struct Column {
    immutable string name;
    immutable int length;
    immutable bool unique;
}
@buggins buggins self-assigned this Sep 16, 2016
@buggins
Copy link
Owner

buggins commented Sep 16, 2016

I believe @UniqueKey() annotation is to be used instead
@entity
class Value {
@id @generated
int id;
@column("name") @UniqueKey("name_index")
string name;
}

Let me know if it's not working as expected.
Closing issue so far.

@buggins buggins closed this as completed Sep 16, 2016
@SingingBush
Copy link
Collaborator Author

thanks for this. I've tried using it but it doesn't seem to work for me.

@buggins buggins reopened this Sep 20, 2016
@KrzaQ
Copy link
Contributor

KrzaQ commented Feb 25, 2017

I tried using it, it didn't work for me either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants