Skip to content

Assert uniqueness of Primary Column values #63

@GregBrimble

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)

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