An ADO.Net data provider connects to a data source such as SQL Server, MySQL, PostgreSQL but also ODBC and OLE DB data source, and provides a way to execute queries against that data source in a consistent manner that is independent of the data source and data source-specific functionality.

Before you connect

DubUrl still requires the ADO.NET provider package and registration of its provider factory.

Learn how to install and register a provider.

To embrace the world of DubUrl, you need to follow some conventions regarding the way you’re providing your connection URL. The table bellow is listing the different aliases than can be provided in the scheme but also the name of the ADO.Net data provider package and the name that you should use as the provider invariant name.

List of Native ADO.Net data providers

Database Aliases Package name / Provider invariant name        
MySQL mysql, my MySqlConnector Go to Nuget repository      
Microsoft SQL Server mssql, ms, sqlserver, mssqlserver Microsoft.Data.SqlClient Go to Nuget repository      
PostgreSQL pg, pgx, pgsql, postgres, postgresql Npgsql Go to Nuget repository      
IBM DB2 db2 IBM.Data.Db2 Go to Nuget repository      
MariaDB maria, mariadb MySqlConnector Go to Nuget repository      
Oracle Database oracle, or, ora Oracle.ManagedDataAccess Go to Nuget repository      
DuckDB duck, duckdb DuckDB.NET.Data Go to Nuget repository      
Firebird SQL fb, firebird FirebirdSql.Data.FirebirdClient Go to Nuget repository      
SQLite3 sq, sqlite Microsoft.Data.Sqlite Go to Nuget repository      
Snowflake sf, snowflake Snowflake.Data Go to Nuget repository      
CrateDB crt, crate, cratedb Npgsql Go to Nuget repository      
Teradata td, teradata, tera, teradatasql Teradata.Client Go to Nuget repository      
CockRoachDB cr, cockroach, cockroachdb, crdb, cdb Npgsql Go to Nuget repository      
SingleStore sg, sgs, singlestore, single, singlestoredb SingleStoreConnector Go to Nuget repository      
Trino tr, trino NReco.PrestoAdo Go to Nuget repository      
Timescale ts, timescale Npgsql Go to Nuget repository      
QuestDb quest, questdb Npgsql Go to Nuget repository      

Additional packages

For encrypted DuckDB files, add DubUrl.Provider.DuckDb.Native alongside the DuckDB family provider and driver, or install the native DuckDB connector archive. Encryption requires native DuckDB 1.4.0 or later. The prepared connection remains a DuckDBConnection subclass.

For SQLite, install the full Microsoft.Data.Sqlite package to include the default native SQLite bundle. If you deliberately use Microsoft.Data.Sqlite.Core, configure its SQLitePCLRaw provider separately. Do not copy DLLs manually as a general installation procedure.

Example

See Your first database connection for a complete PostgreSQL example, including package installation, explicit factory registration, and disposal. Other native providers follow the same sequence using the package, invariant name, and scheme listed above.