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

IdTable.new cannot use SEQUENCE nextVal #1002

Closed
afk11 opened this issue Jul 22, 2020 · 0 comments
Closed

IdTable.new cannot use SEQUENCE nextVal #1002

afk11 opened this issue Jul 22, 2020 · 0 comments

Comments

@afk11
Copy link

afk11 commented Jul 22, 2020

Hi,
I opened a PR about adding Long value support to Sequence NextVal.. I decided I'd keep developing using Int instead of Long so I don't have to wait for the PR to be merged.

I've realized I have another problem though - if the table is to be used as an Entity, the id column type is Column<EntityID<Int>> and not Column<Int>. So now I'm a bit lost about how to proceed, but feel it's connected in some way to #1001, so I'd hope that PR can fix both :)

// works today
private object Developer : Table() {
    val id = integer("id")
    var name = varchar("name", 25)

    override val primaryKey = PrimaryKey(id, name)
}

// works with #1001 
private object DeveloperLong : Table() {
    val id = long("id")
    var name = varchar("name", 25)

    override val primaryKey = PrimaryKey(id, name)
}

# doesn't work right now
private object DevelopersTable : IdTable<Int>() {
    override val id = integer("id").entityId()
    var name = varchar("name", 25)
}
@afk11 afk11 changed the title IdTable cannot use SEQUENCE nextVal IdTable.new cannot use SEQUENCE nextVal Jul 22, 2020
@Tapac Tapac closed this as completed Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants