Skip to content

How to use DoUpdate with a TypeConverter field #1556

Answered by simolus3
JeremyLWright asked this question in Q&A
Discussion options

You must be logged in to vote

It's true that the .custom companion constructor doesn't support type converters. It can't, really: The Expression passed can be any SQL value and it's not obvious how a type converter might be applied to that. Ideally, the companion should expect an Expression<int> here as that's the type in the database. This was an oversight from my side, but it's a breaking change to fix.

So, until the next major release, it looks like you'll have to work around this with number: Variable(2).dartCast(). Sorry for the inconvenience, it will get better :D

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@JeremyLWright
Comment options

@simolus3
Comment options

@JeremyLWright
Comment options

Answer selected by JeremyLWright
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants