Mysql Syntax error executing query
Hi i got this issue:
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(select coalesce(json_arrayagg(json_array(
stores_categories
.id_store
, `store' at line 1
when i try to run this query:
and in images you can see my db connection, and schemas![No description](https://cdn.answeroverflow.com/1156903034912256054/image.png)
![No description](https://cdn.answeroverflow.com/1156903035293945897/image.png)
![No description](https://cdn.answeroverflow.com/1156903035864363039/image.png)
![No description](https://cdn.answeroverflow.com/1156903036363493376/image.png)
![No description](https://cdn.answeroverflow.com/1156903037189763163/image.png)
17 Replies
This might be an issue. Can you show the query that got generated? Can you create a reproduction repo?
i can give you the git repo, how can i see the query dat got generated ?
You can pass
logger: true
to the drizzle object, in the same place where you pass the schemathis is what i got:
If you give me your github tag i will add you to my repo
This looks like it's an issue, a repro repo is better so others can reproduce it independently as well.
Hi !
i need your github tag to add you to the repo
Angelelz
i just added you.
The query is here: https://github.com/Hrobitaillie/streeteats/blob/main/admin/hooks/getStore.ts
This is not a repro repo, this is an app
I don't have clerk, and I don't know what database you have set up
Please create a reproduction repo
The reason I ask, is not to annoy you with additional steps, it's because sometimes, those are not really issues, but some error in the code that you might have, so building a repro repo helps you go over your own steps and possibly figuring it out
i do'nt know what is a repo repo i will check on googl
By the way if i try to execute this query on phpmyadmin i get the same issue so i think it's a mysql issue depending on the version, but the probleme is i can't change the generated query from drizzle
Does this repo work for you? where are you importing your db from?
You also don't have any seeding data for the stores to test your query
GitHub
GitHub - Angelelz/repro-streetarts: reproduction repository
reproduction repository. Contribute to Angelelz/repro-streetarts development by creating an account on GitHub.
This is a reproduction repository, it's a repository that contains the minimal code/libraries to reproduce the error that you are seeing
it serves several purposes, it helps the library maintainers identify very easily the code that has issues, it helps you verify that the issue you're having is reproducible, it helps you go back through your steps and make sure you didn't miss anything
Anyway, I could not reproduce your issue, if you clone/fork that repository, you follow the steps in the readme, you'll see that the query does not throw any errors
Well,
Thank you for all your time, i really appreciate.
I understand the purpose of a reproduction repo.
Because of i am to much a beginner with full stacks and mysql, i mooved to prisma that si more easy to use at level
SomeOne could resolve this?
I have the same problem and this is the only thing that I found 😦