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

Treating all types as nullable during insert is preventing the use of sql_function! in Insertable structs #921

Closed
Eijebong opened this Issue May 22, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@Eijebong
Member

Eijebong commented May 22, 2017

Here is a gist with the code to reproduce and the full error message.

https://gist.github.com/Eijebong/70aacb440d1bc5344c8ac3ff045626af

@sgrif sgrif added this to the 1.0 milestone Jun 5, 2017

sgrif added a commit that referenced this issue Jul 5, 2017

Don't treat all fields as nullable for insert
This issue was introduced in f4511c6,
and I'm really not sure what I was thinking there. We've always treated
`None` values as `DEFAULT`, so there was no reason not to be extracting
the inner values when I wrote that.

This will allow enhancements to inserts like using expressions other
than bind params, and using tuples for one-off inserts similar to how
updates work.

Fixes #921.

sgrif added a commit that referenced this issue Jul 5, 2017

Don't treat all fields as nullable for insert
This issue was introduced in f4511c6,
and I'm really not sure what I was thinking there. We've always treated
`None` values as `DEFAULT`, so there was no reason not to be extracting
the inner values when I wrote that.

This will allow enhancements to inserts like using expressions other
than bind params, and using tuples for one-off inserts similar to how
updates work.

Fixes #921.

sgrif added a commit that referenced this issue Jul 5, 2017

Don't treat all fields as nullable for insert
This issue was introduced in f4511c6,
and I'm really not sure what I was thinking there. We've always treated
`None` values as `DEFAULT`, so there was no reason not to be extracting
the inner values when I wrote that.

This will allow enhancements to inserts like using expressions other
than bind params, and using tuples for one-off inserts similar to how
updates work.

Fixes #921.

@sgrif sgrif closed this in 38038f6 Jul 5, 2017

Fiedzia added a commit to Fiedzia/diesel that referenced this issue Jul 6, 2017

Don't treat all fields as nullable for insert
This issue was introduced in f4511c6,
and I'm really not sure what I was thinking there. We've always treated
`None` values as `DEFAULT`, so there was no reason not to be extracting
the inner values when I wrote that.

This will allow enhancements to inserts like using expressions other
than bind params, and using tuples for one-off inserts similar to how
updates work.

Fixes diesel-rs#921.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment