cmeeren / Facil

Facil generates F# data access source code from SQL queries and stored procedures. Optimized for developer happiness.
MIT License
140 stars 7 forks source link

Version 2.3.1 raising error when using connectionString: $([Variable Name]) #38

Closed mauriciomagni closed 2 years ago

mauriciomagni commented 2 years ago

After updating to version 2.3.1, it started raising an error when trying to generate DbGen file, saying: facil.yaml(0 , 0) : error : The variable $(Db) could not be found in the specified configuration sources

Going back to version 2.3.0 works as expected.

In my facil.yaml file I have this configuration:

rulesets:
  - connectionString: $(Db)
cmeeren commented 2 years ago

I can't reproduce. The following works fine in Facil's test project:

configs:
  - appSettings: appsettings.json

rulesets:
  - connectionString: $(connectionString)

I need a minimal repro. Could you create one?

cmeeren commented 2 years ago

Also, please verify that the variable casing is correct (e.g., that it is Db and not db in your config source).

mauriciomagni commented 2 years ago

hello Cmeeren The casing is correct, and we have been using it until this new version. I will create a small project to try to reproduce this error. Something I did not mentioned before is the "configs:" configuration:

configs:
  - envVars: MyApp__

I will get back to you with minimal repro. Kind regards, Mauricio

mauriciomagni commented 2 years ago

Dear Cmeeren Here is the minamal repro: Facil231.zip Here is how I have configure the environment variable: image Hope this help. If you cannot look at it, I will try to create a pull request during the weekend. Regards, Mauricio

cmeeren commented 2 years ago

Thanks, I'll have a look at it. If you happen to know where the bug is, don't hesitate to let me know.

cmeeren commented 2 years ago

This is caused by https://github.com/dotnet/runtime/issues/65756.

I'll downgrade if there's no new fix published.

cmeeren commented 2 years ago

Fixed in v2.3.2.

mauriciomagni commented 2 years ago

Thanks a lot!