kenepa / translation-manager

Manage your application's translations in Filament.
MIT License
86 stars 27 forks source link

Syntax error: 7 ERROR: syntax error at or near "group" using postgresql #61

Closed tuseto closed 1 week ago

tuseto commented 2 weeks ago

When search into the search input it throws an exception: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "group" LINE 1: ...) as aggregate from "language_lines" where (lower(group::tex..

The database is postgresql so because there is no (JSON_ARRAY()) as in the docs I've used just ->default(json_encode([]))

"name": "kenepa/translation-manager", "version": "4.0.11",

"name": "laravel/framework", "version": "v11.26.0",

Shared error: https://flareapp.io/share/dPbERpAm

Jehizkia commented 1 week ago

Hi thanks for reporting,

I'm not familar with this issue. But could you maybe try to use json_build_array() which is supported by postgresql according to: https://www.postgresql.org/docs/9.4/functions-json.html.

tuseto commented 1 week ago

@Jehizkia same.

I am wondering can the issue be with that group is a keyword in postgresql? I am not aware of how this query exactly is built because laravel query builder should take care of such problem

Jehizkia commented 1 week ago

Ah yes, you are correct. I managed to kind of replicate the issue outside of the project by running a similar query. I'll dive deeper into the issue.