Infer() use cases #1264
-
Hello, In what cases is Infer() safe to use? I stumbled upon a foot-gun where Appreciate the input. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Infer is a way for SQLBoiler to translate Go's "zero type" to what your DB could be expecting. If a column is "NOT NULL" with no default, This is how |
Beta Was this translation helpful? Give feedback.
Infer is a way for SQLBoiler to translate Go's "zero type" to what your DB could be expecting.
If a column is "NOT NULL" with no default,
Infer
will pass the zero value of the column if not set. The reason is that your database is expecting a value to be set.This is how
infer
is expected to work. If you prefer more control you can use "Whitelist" or "Blacklist".