ent: Query pagination error: wrong number of arguments to function COUNT()
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior ๐ฏ
query := client.MyModel.Query()
r, err := query.Select(fields...).Paginate(...)
err
is โwrong number of arguments to function COUNT()โ
Expected Behavior ๐ค
Should return results normally as in version 0.10.0
Your Environment ๐
Tech | Version |
---|---|
Go | 1.19.1 |
Ent | 0.11.3 |
Database | SQLite3 |
Driver | github.com/mattn/go-sqlite3 v1.14.15 |
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (2 by maintainers)
Hello @vincentluan, Iโm so happy because the issue was gone.
The master branch is stable enough for use in the production environment (with the
go.mod
file as version locking). However, I will ask @a8m to create a new tag for the new users without having the same issue.We welcome you to our community on Discord for faster support and response: https://discord.gg/qZmPgTE6RX
Again, thank you so much for reporting the issue and the effort for it.
@giautm itโs working now, thanks a lot for your help ๐
Hey guys, it seems that the declaration of
fieldSeen
will be missing when usingAnnotations(entgql.Skip())
in schema:The error with function COUNT() is still happening with the latest version in master branches, using the same query as in my original example. Here is how I create the test client:
This will cause the error when
fields
contains 2 or more field names:Hello @a8m, this is still happening and I have upgraded both
ent
andcontrib
to the latest commit on master. And another error has presented itself: one of thecollectField
function ingql_collection.go
is missing its declaration forfieldSeen
and other variables.