SQLProvider Documentation

repository·master·Indexed 20 days ago

https://github.com/fsprojects/sqlprovider

A .NET type provider for F# that compiles SQL database schemas into strongly-typed .NET objects at compile time. It supports LINQ queries, stored procedures, and transactional CRUD operations across multiple vendors including SQL Server, PostgreSQL, MySQL, Oracle, SQLite, and others via ODBC. Compatible with .NET Standard and .NET Core.

Tokens
623
Snippets
0
Records
3
Agent score
21%

What's inside SQLProvider

  1. Overview of SQLProvider features

    master

    SQLProvider is a general .NET SQL database type provider that compiles your database schema into .NET types, eliminating the need for manual OR-mapping.

    Key features include:

    • Querying: LINQ queries, Stored Procedures, Functions, and Composable Query integration.
    • Data Operations: Transactional CRUD operations with identity support, two-way data binding, and mapping to record types.
    • Schema Exploration: Lazy schema exploration and automatic constraint navigation.
    • Advanced Support: Optional option types, custom operators, and asynchronous operations.
    • Compatibility: Supports .NET Standard and .NET Core. It also supports saving DB schemas offline and using SQL-Server *.dacpac files.
    • Vendor Support: Explicit implementations for SQL Server, SQLite, PostgreSQL, Oracle, MySQL/MariaDB, MsAccess, Firebird, and DuckDB, plus a general ODBC provider.
  2. Install SQLProvider via NuGet

    master

    SQLProvider is distributed via NuGet packages. You must install the specific package corresponding to your database vendor. The namespace for the SqlDataProvider type class varies depending on the package used.

    DatabaseNuGet PackageTypeProvider Class
    Microsoft SQL ServerSQLProvider.MsSqlFSharp.Data.Sql.MsSql.SqlDataProvider
    PostgreSQLSQLProvider.PostgreSqlFSharp.Data.Sql.PostgreSql.SqlDataProvider
    MySQL and MariaDBSQLProvider.MySqlConnectorFSharp.Data.Sql.MySqlConnector.SqlDataProvider
    MySQLSQLProvider.MySqlFSharp.Data.Sql.MySql.SqlDataProvider
    OracleSQLProvider.OracleFSharp.Data.Sql.Oracle.SqlDataProvider
    Any ODBC connectionSQLProvider.OdbcFSharp.Data.Sql.Odbc.SqlDataProvider
    SQLiteSQLProvider.SQLiteFSharp.Data.Sql.SQLite.SqlDataProvider
    Microsoft AccessSQLProvider.MsAccessFSharp.Data.Sql.MsAccess.SqlDataProvider
    FirebirdSQLProvider.FirebirdFSharp.Data.Sql.Firebird.SqlDataProvider
    DuckDBSQLProvider.DuckDbFSharp.Data.Sql.DuckDb.SqlDataProvider
    General (manual config)SQLProviderFSharp.Data.Sql.SqlDataProvider
  3. Troubleshoot dynamic assembly loading issues

    master

    For database vendors other than SQL Server and Access, SQLProvider uses dynamic assembly loading. This may trigger security restrictions depending on your system configuration or .NET framework version.

    If you encounter problems loading dynamic assemblies, you may need to adjust the configuration files for fsi.exe, devenv.exe, or your specific application to allow these loads.