You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're having a generation problem please answer these questions before submitting your issue. Thanks!
What version of SQLBoiler are you using (sqlboiler --version)?
v4.14.1
What is your database and version (eg. Postgresql 10)
Postgresql 13.1
If this happened at generation time what was the full SQLBoiler command you used to generate your models? (if not applicable leave blank)
If this happened at runtime what code produced the issue? (if not applicable leave blank)
What is the output of the command above with the -d flag added to it? (Provided you are comfortable sharing this, it contains a blueprint of your schema)
Please provide a relevant database schema so we can replicate your issue (Provided you are comfortable sharing this)
CREATE TABLE IF NOT EXISTS animals (
id NOT NULL PRIMARY KEY,
specie VARCHAR(200) UNIQUE
)
CREATE TABLE IF NOT EXISTS cats (
id NOT NULL PRIMARY KEY,
specie VARCHAR(200) NOT NULL UNIQUE REFERENCES animals(specie)
)
Further information. What did you do, what did you expect?
I had a function like this to get cat info by specie, loading the Animals relation alongside:
If you're having a generation problem please answer these questions before submitting your issue. Thanks!
What version of SQLBoiler are you using (
sqlboiler --version
)?v4.14.1
What is your database and version (eg. Postgresql 10)
Postgresql 13.1
If this happened at generation time what was the full SQLBoiler command you used to generate your models? (if not applicable leave blank)
If this happened at runtime what code produced the issue? (if not applicable leave blank)
What is the output of the command above with the
-d
flag added to it? (Provided you are comfortable sharing this, it contains a blueprint of your schema)Please provide a relevant database schema so we can replicate your issue (Provided you are comfortable sharing this)
Further information. What did you do, what did you expect?
I had a function like this to get cat info by specie, loading the Animals relation alongside:
When called, it panicked instead:
Basically, because specie on cats table is a string, it breaks at this part of the code:
When I removed the not null constraint on the cats table, the error was gone, because specie is now
null.String
The text was updated successfully, but these errors were encountered: