Replies: 1 comment
-
|
Hello! I think keeping the sql queries under the src folder is a little more convenient because that means you don't have to replicate the src folder structure to make sure each group of queries end up where they should be once generated (the generated code would still need to be in dev!). And the compiler already ignores any non-gleam file under |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Squirrel, by design, requires sql scripts to be placed in the
srcfolder, along with the Gleam code. That was a decision that made a lot of sense when Gleam projects only had asrcand atestfolder at the root: this sql code isn't made for tests.However, in Gleam 1.11, the
devfolder was introduced. In the release notes, Louis poses the following question as a justification for this folder: what if you have some other code you need to run in development? For example, if you're making a backend web application you might want to have some extra code that configures a local development database, or compiles some frontend assets. Where would you put the code that does this?The SQL code used by Squirrel seems to fit that description perfectly: it is a development dependency, but not directly used in the final product, since it is transformed into Gleam code by Squirrel.
Would it make sense to have
gleam -m squirrelverify the content of the dev folder to generate Gleam code, instead of requiring it to be in the src folder? What could be the possible challenges?Beta Was this translation helpful? Give feedback.
All reactions