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
When you're creating a new sqlc.yaml file, if you use a - in the name of the package, a compilation error will occur. The main issue here is that the error message doesn't help understand the problem.
Example
Let's say I want a random name like orders-gen or something like that:
This configuration will raise the following error:
Now, if you change orders-gen to orders_gen, it works just fine.
Why?
Let's analyze the error message.
error generating code: source error: 7:15: expected ';', found '-'
It clearly says that I'm using a - and that it was expecting a ;? It lacks information. Where is the issue? Is it related to my SQL code, or is it the configuration file? No clue.
If you aren't aware of that fact, you might end up spending a couple of hours trying to figure out the problem. My "solution" is to either make the conventions of the compiler clear during the tutorial or improve the error handling to give a better experience to anyone using the package.
What operating system are you using?
Linux
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Version
1.29.0
What happened?
Issue
When you're creating a new
sqlc.yaml
file, if you use a-
in the name of the package, a compilation error will occur. The main issue here is that the error message doesn't help understand the problem.Example
Let's say I want a random name like
orders-gen
or something like that:This configuration will raise the following error:
Now, if you change
orders-gen
toorders_gen
, it works just fine.Why?
Let's analyze the error message.
It clearly says that I'm using a
-
and that it was expecting a;
? It lacks information. Where is the issue? Is it related to my SQL code, or is it the configuration file? No clue.If you aren't aware of that fact, you might end up spending a couple of hours trying to figure out the problem. My "solution" is to either make the conventions of the compiler clear during the tutorial or improve the error handling to give a better experience to anyone using the package.
What operating system are you using?
Linux
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: