Skip to content
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

Bug: various int arrays are generated as types.Int64Array which leads to out of range errors in tests #1308

Open
erezrokah opened this issue Sep 21, 2023 · 0 comments

Comments

@erezrokah
Copy link

What version of SQLBoiler are you using (sqlboiler --version)?

SQLBoiler v4.15.0 (Actually I'm using the latest code from master)

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)

create table if not exists my_table(
    id serial primary 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:

case "bigint", "bigserial", "integer", "serial", "smallint", "smallserial", "oid":
, which means when seeding the values with random data it can overflow the DB type

@erezrokah 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant