Skip to content

Assert uniqueness of Primary Column values #63

Description

@GregBrimble

Nothing currently stopping you from doing:

@Entity({ datastore })
class User {
    @Column({ isPrimary: true })
    public id: string

    @Column()
    public name: string

    constructor(id, name) {
        this.id = id
        this.name = name
    }
}

const userRepository = getRepository(User)

const instance = new User('123', 'Jack')
await userRepository.save(instance)

const otherInstance = new User('123', 'Jill')
await userRepository.save(otherInstance)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions