-
Hello. I'm trying to figure out how to allow insertion/retrieval of null values from a table with *RETURNING state. I don't use the "DEFAULT" block in migrations and would like to somehow get "NULL" values in the output - is this possible or should I use "NOT NULL" or "DEFAULT" argument when creating tables? version:
problem is there:
.get_result method gives me a warning:
is this because Rust can't handle a null/none/nil type properly? If I remove the "optional" block from fields in NewEntity structure - I don't get any warnings/errors in .get_result method
or
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
That error occurs because you use types like
Questions about whether something is "possible" are almost always answerable with: "Yes". In this case yes that's possible, but you need to bring your own DSL extension for window functions.
Diesel itself does not have a known way to run into N+1 query problems. You can create N+1 problems as with every database driver by executing queries in an explicit loop, but that depends then on your code. It's up to you to resolve that. |
Beta Was this translation helpful? Give feedback.
-
Could you please explain how I could implement this DSL extension for window functions? Maybe there are examples of step-by-step implementations or do I need to know Rust deeply enough and be familiar with the internal implementation of diesel? Could you please provide an example of using the driver directly through diesel and say execute the query "SELECT * FROM waq WHERE id = 1" |
Beta Was this translation helpful? Give feedback.
See the documentation
Again see the documentation