Skip to content

Assert uniqueness of Primary Column values #63

Open

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

  1. added
    bug
    on Nov 19, 2019
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions