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
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)
» go test ./... -count=1 --cover -v
? boil/dbmodels [no test files]
=== RUN TestSqlBoiler
Debug: INSERT INTO "mytable" ("id","name") VALUES ($1,$2)
Debug: [132cff82-ee1a-47d2-967b-681f6951015a test]
Debug: INSERT INTO "mytable" (""id"",""name"") VALUES ($1,$2) ON CONFLICT ("id") DO UPDATE SET "name" = EXCLUDED."name" RETURNING "id"
Debug: [e65f2549-9a95-4030-8af5-5b5ad7b6509d test]
main_test.go:49: dbmodels: unable to upsert mytable: pq: zero-length delimited identifier at or near """"
--- FAIL: TestSqlBoiler (0.02s)
FAIL
FAIL boil 0.208s
FAIL
Please provide a relevant database schema so we can replicate your issue (Provided you are comfortable sharing this)
CREATETABLEIF NOT EXISTS mytable
(
"id"VARCHAR(128) PRIMARY KEYNOT NULLCHECK ("id"<>''),
"name"VARCHAR(100) NOT NULLCHECK ("name"<>'')
);
Further information. What did you do, what did you expect?
When generating with SQL boiler v4.15.0 and adding go mod dependencies for github.com/volatiletech/sqlboiler/v4 v4.15.0 and github.com/volatiletech/strmangle v0.0.5, the test passes and outputs:
Debug: INSERT INTO "mytable" ("id","name") VALUES ($1,$2)
Debug: [51194c00-09a8-4646-8f7a-9a37ec690d24 test]
Debug: INSERT INTO "mytable" ("id", "name") VALUES ($1,$2) ON CONFLICT ("id") DO UPDATE SET "name" = EXCLUDED."name"
Debug: [c9f4e751-9b3a-4f71-8aea-6684208d6529 test]
Debug: INSERT INTO "mytable" ("id", "name") VALUES ($1,$2) ON CONFLICT ("id") DO UPDATE SET "name" = EXCLUDED."name"
Debug: [c9f4e751-9b3a-4f71-8aea-6684208d6529 test2]
Changing to SQL boiler v4.16.0 and adding go mod dependencies for github.com/volatiletech/sqlboiler/v4 v4.16.0 and github.com/volatiletech/strmangle v0.0.6, the test fails and outputs:
Debug: INSERT INTO "mytable" ("id","name") VALUES ($1,$2)
Debug: [132cff82-ee1a-47d2-967b-681f6951015a test]
Debug: INSERT INTO "mytable" (""id"",""name"") VALUES ($1,$2) ON CONFLICT ("id") DO UPDATE SET "name" = EXCLUDED."name" RETURNING "id"
Debug: [e65f2549-9a95-4030-8af5-5b5ad7b6509d test]
main_test.go:49: dbmodels: unable to upsert mytable: pq: zero-length delimited identifier at or near """"
The resulting sql statement for upsert changes for the upsert call causing error returned from generated code:
4.15.0: INSERT INTO "mytable" ("id", "name") VALUES ($1,$2) ON CONFLICT ("id") DO UPDATE SET "name" = EXCLUDED."name"
4.16.0: INSERT INTO "mytable" (""id"",""name"") VALUES ($1,$2) ON CONFLICT ("id") DO UPDATE SET "name" = EXCLUDED."name" RETURNING "id"
not sure if its the double quotes or RETURNING "id" causing the failure but based on error message I would guess its the double quotes
The text was updated successfully, but these errors were encountered:
What version of SQLBoiler are you using (
sqlboiler --version
)?SQLBoiler v4.16.0
What is your database and version (eg. Postgresql 10)
postgresql 14
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?
When generating with SQL boiler v4.15.0 and adding go mod dependencies for
github.com/volatiletech/sqlboiler/v4 v4.15.0
andgit.luolix.top/volatiletech/strmangle v0.0.5
, the test passes and outputs:Changing to SQL boiler v4.16.0 and adding go mod dependencies for
github.com/volatiletech/sqlboiler/v4 v4.16.0
andgit.luolix.top/volatiletech/strmangle v0.0.6
, the test fails and outputs:The resulting sql statement for upsert changes for the upsert call causing error returned from generated code:
not sure if its the double quotes or RETURNING "id" causing the failure but based on error message I would guess its the double quotes
The text was updated successfully, but these errors were encountered: