Hi everybody,
I like to specify my db connection in a yaml config. So I followed
On their own they work pretty good. Together it does not compile.
E.g:
open FSharp.Data.Sql
open FSharp.Configuration
[<Literal>]
let configPath = __SOURCE_DIRECTORY__ + "/" + "config.yaml"
type Config = YamlConfig<configPath>
let config = Config()
let db = config.DB
//[<Literal>]
let connStr = $"User ID={db.UserId}..."
[<Literal>]
let connStrLiteral = "User ID=..."
type HR = SqlDataProvider<
Common.DatabaseProviderTypes.POSTGRESQL, connStr,
ResolutionPath = resolutionPath>
connStrLiteral
works but it is hard-coded. With connStr
I get
This is not a valid constant expression or custom attribute valueF# Compiler267
Do type providers not work in conjunction? Does somebody know a workaround?
Thank you!