You can certainly specify the connection string using a key in a configuration file (see MSDN documentation):
SqlDataConnection<ConnectionStringName="...", ConfigFile="app.config">
In general, a type provider may require some constant expression, but I think most of the widely used ones provide a way for avoiding this. For example, SqlDataConnection
can read the setting from configuration file, other standard F# type providers allow specifying LocalSchemaFile
that allows you to specify the necessary structure locally (e.g. *.dbml
file for SQL).
The F# Data type providers can take URL to a remote file, but they can also take local file. So I think that there should always be a way to specify the information without specifying a constant connection string (etc.) - but feel free to ask about specific providers.