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 this happened at runtime what code produced the issue? (if not applicable leave blank)
N/A
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)
createtableif not exists my_table(
id serialprimary key,
small_ints smallint[]
);
Further information. What did you do, what did you expect?
Looks like various types of int arrays are always generated as types.Int64Array:
, which means when seeding the values with random data it can overflow the DB type
The text was updated successfully, but these errors were encountered:
erezrokah
changed the title
Bug: various int arrays are generated as types.Int64Array which leads to our of range errors in tests
Bug: various int arrays are generated as types.Int64Array which leads to out of range errors in tests
Sep 21, 2023
I am facing the same problem.
From the source code, looks like int32 arrays are not checked. I think it would be a matter of adding a []int check before the int64 check and a new IntArray type. But this could cause overflow if the int in question is int64, just not over 32 bits in value yet...
I am working around this by manually modifying the generated files to match my schema definition, but this is hard to maintain. Maybe it would be useful to define overrides in the generation process?
What version of SQLBoiler are you using (
sqlboiler --version
)?SQLBoiler v4.15.0
(Actually I'm using the latest code frommaster
)What is your database and version (eg. Postgresql 10)
Postgres 15
If this happened at generation time what was the full SQLBoiler command you used to generate your models? (if not applicable leave blank)
sqlboiler psql --wipe --no-hooks --no-auto-timestamps --no-back-referencing
If this happened at runtime what code produced the issue? (if not applicable leave blank)
N/A
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?
Looks like various types of int arrays are always generated as
types.Int64Array
:sqlboiler/drivers/sqlboiler-psql/driver/psql.go
Line 918 in 59e63d5
The text was updated successfully, but these errors were encountered: