Class DuckDBConnection
public class DuckDBConnection : DbConnection, IComponent, IDbConnection, IDisposable, IAsyncDisposable
- Inheritance
-
Duck
DBConnection
- Implements
- Inherited Members
Constructors
DuckDBConnection()
DuckDBConnection(string)
Parameters
connectionStringstring
Properties
ConnectionString
When overridden in a derived class, gets or sets the string used to open the connection.
Property Value
- string
The connection string used to establish the initial connection. The exact contents of the connection string depend on the specific data source for this connection. The default value is an empty string.
DataSource
When overridden in a derived class, gets the name of the database server to which to connect.
Property Value
- string
The name of the database server to which to connect. The default value is an empty string.
Database
When overridden in a derived class, gets the name of the current database after a connection is opened, or the database name specified in the connection string before the connection is opened.
Property Value
- string
The name of the current database or the name of the database to be used after a connection is opened. The default value is an empty string.
DbProviderFactory
Gets the Db
Property Value
- Db
Provider Factory A set of methods for creating instances of a provider's implementation of the data source classes.
NativeConnection
Returns the native connection object that can be used to call DuckDB C API functions.
Property Value
ServerVersion
When overridden in a derived class, gets a string that represents the version of the server to which the object is connected.
Property Value
- string
The version of the database. The format of the string returned depends on the specific type of connection you are using.
Exceptions
- Invalid
Operation Exception Server
Version was called while the returned Task was not completed and the connection was not opened after a call to System.Data. .Common. Db Connection. Open Async*
State
Gets a string that describes the state of the connection.
Property Value
- Connection
State The state of the connection. The format of the string returned depends on the specific type of connection you are using.
Methods
BeginDbTransaction(IsolationLevel)
When overridden in a derived class, starts a database transaction.
Parameters
isolationLevelIsolationLevel One of the enumeration values that specifies the isolation level for the transaction to use.
Returns
- Db
Transaction An object representing the new transaction.
BeginTransaction()
Returns
Bind(nint)
Parameters
infonint
ChangeDatabase(string)
When overridden in a derived class, changes the current database for an open connection.
Parameters
databaseNamestringThe name of the database for the connection to use.
Close()
When overridden in a derived class, closes the connection to the database.
CreateAppender(string)
Parameters
tablestring
Returns
CreateAppender(string?, string)
Parameters
Returns
CreateAppender(string?, string?, string)
Parameters
Returns
CreateCommand()
Returns
CreateDbCommand()
When overridden in a derived class, creates and returns a Db
Returns
Dispose(bool)
Releases the unmanaged resources used by the Component and optionally releases the managed resources.
Parameters
disposingbooltrue to release both managed and unmanaged resources; false to release only unmanaged resources.
Duplicate()
Returns
GetQueryProgress()
Returns
GetSchema()
Returns schema information for the data source of this Db
Returns
GetSchema(string)
Returns schema information for the data source of this Db
Parameters
collectionNamestringSpecifies the name of the schema to return.
Returns
Exceptions
- Argument
Exception collectionNameis specified as null.
GetSchema(string, string?[]?)
Returns schema information for the data source of this Db
Parameters
collectionNamestringSpecifies the name of the schema to return.
restrictionValuesstring[]Specifies a set of restriction values for the requested schema.
Returns
Exceptions
- Argument
Exception collectionNameis specified as null.
Init(nint)
Parameters
infonint
Open()
When overridden in a derived class, opens a database connection with the settings specified by the Connection
RegisterScalarFunction<TResult>(string, Action<IDuckDBDataWriter, ulong>, bool)
public void RegisterScalarFunction<TResult>(string name, Action<IDuckDBDataWriter, ulong> action, bool isPureFunction = false)
Parameters
namestringactionAction<IDuckDBData , ulong>Writer isPureFunctionbool
Type Parameters
TResult
RegisterScalarFunction<T, TResult>(string, Action<IReadOnlyList<IDuckDBDataReader>, IDuckDBDataWriter, ulong>, bool, bool)
public void RegisterScalarFunction<T, TResult>(string name, Action<IReadOnlyList<IDuckDBDataReader>, IDuckDBDataWriter, ulong> action, bool isPureFunction = true, bool @params = false)
Parameters
namestringactionAction<IReadOnly <IDuckList DBData >, IDuckReader DBData , ulong>Writer isPureFunctionboolparamsbool
Type Parameters
TTResult
RegisterScalarFunction<T1, T2, TResult>(string, Action<IReadOnlyList<IDuckDBDataReader>, IDuckDBDataWriter, ulong>, bool)
public void RegisterScalarFunction<T1, T2, TResult>(string name, Action<IReadOnlyList<IDuckDBDataReader>, IDuckDBDataWriter, ulong> action, bool isPureFunction = true)
Parameters
namestringactionAction<IReadOnly <IDuckList DBData >, IDuckReader DBData , ulong>Writer isPureFunctionbool
Type Parameters
T1T2TResult
RegisterScalarFunction<T1, T2, T3, TResult>(string, Action<IReadOnlyList<IDuckDBDataReader>, IDuckDBDataWriter, ulong>, bool)
public void RegisterScalarFunction<T1, T2, T3, TResult>(string name, Action<IReadOnlyList<IDuckDBDataReader>, IDuckDBDataWriter, ulong> action, bool isPureFunction = true)
Parameters
namestringactionAction<IReadOnly <IDuckList DBData >, IDuckReader DBData , ulong>Writer isPureFunctionbool
Type Parameters
T1T2T3TResult
RegisterScalarFunction<T1, T2, T3, T4, TResult>(string, Action<IReadOnlyList<IDuckDBDataReader>, IDuckDBDataWriter, ulong>, bool)
public void RegisterScalarFunction<T1, T2, T3, T4, TResult>(string name, Action<IReadOnlyList<IDuckDBDataReader>, IDuckDBDataWriter, ulong> action, bool isPureFunction = true)
Parameters
namestringactionAction<IReadOnly <IDuckList DBData >, IDuckReader DBData , ulong>Writer isPureFunctionbool
Type Parameters
T1T2T3T4TResult
RegisterTableFunction(string, Func<TableFunction>, Action<object?, IDuckDBDataWriter[], ulong>)
public void RegisterTableFunction(string name, Func<TableFunction> resultCallback, Action<object?, IDuckDBDataWriter[], ulong> mapperCallback)
Parameters
namestringresultCallbackFunc<TableFunction >mapperCallbackAction<object, IDuckDBData [], ulong>Writer
RegisterTableFunction<T>(string, Func<IReadOnlyList<IDuckDBValueReader>, TableFunction>, Action<object?, IDuckDBDataWriter[], ulong>)
public void RegisterTableFunction<T>(string name, Func<IReadOnlyList<IDuckDBValueReader>, TableFunction> resultCallback, Action<object?, IDuckDBDataWriter[], ulong> mapperCallback)
Parameters
namestringresultCallbackFunc<IReadOnly <IDuckList DBValue >, TableReader Function >mapperCallbackAction<object, IDuckDBData [], ulong>Writer
Type Parameters
T
RegisterTableFunction<T1, T2>(string, Func<IReadOnlyList<IDuckDBValueReader>, TableFunction>, Action<object?, IDuckDBDataWriter[], ulong>)
public void RegisterTableFunction<T1, T2>(string name, Func<IReadOnlyList<IDuckDBValueReader>, TableFunction> resultCallback, Action<object?, IDuckDBDataWriter[], ulong> mapperCallback)
Parameters
namestringresultCallbackFunc<IReadOnly <IDuckList DBValue >, TableReader Function >mapperCallbackAction<object, IDuckDBData [], ulong>Writer
Type Parameters
T1T2
RegisterTableFunction<T1, T2, T3>(string, Func<IReadOnlyList<IDuckDBValueReader>, TableFunction>, Action<object?, IDuckDBDataWriter[], ulong>)
public void RegisterTableFunction<T1, T2, T3>(string name, Func<IReadOnlyList<IDuckDBValueReader>, TableFunction> resultCallback, Action<object?, IDuckDBDataWriter[], ulong> mapperCallback)
Parameters
namestringresultCallbackFunc<IReadOnly <IDuckList DBValue >, TableReader Function >mapperCallbackAction<object, IDuckDBData [], ulong>Writer
Type Parameters
T1T2T3
RegisterTableFunction<T1, T2, T3, T4>(string, Func<IReadOnlyList<IDuckDBValueReader>, TableFunction>, Action<object?, IDuckDBDataWriter[], ulong>)
public void RegisterTableFunction<T1, T2, T3, T4>(string name, Func<IReadOnlyList<IDuckDBValueReader>, TableFunction> resultCallback, Action<object?, IDuckDBDataWriter[], ulong> mapperCallback)
Parameters
namestringresultCallbackFunc<IReadOnly <IDuckList DBValue >, TableReader Function >mapperCallbackAction<object, IDuckDBData [], ulong>Writer
Type Parameters
T1T2T3T4
RegisterTableFunction<T1, T2, T3, T4, T5>(string, Func<IReadOnlyList<IDuckDBValueReader>, TableFunction>, Action<object?, IDuckDBDataWriter[], ulong>)
public void RegisterTableFunction<T1, T2, T3, T4, T5>(string name, Func<IReadOnlyList<IDuckDBValueReader>, TableFunction> resultCallback, Action<object?, IDuckDBDataWriter[], ulong> mapperCallback)
Parameters
namestringresultCallbackFunc<IReadOnly <IDuckList DBValue >, TableReader Function >mapperCallbackAction<object, IDuckDBData [], ulong>Writer
Type Parameters
T1T2T3T4T5
RegisterTableFunction<T1, T2, T3, T4, T5, T6>(string, Func<IReadOnlyList<IDuckDBValueReader>, TableFunction>, Action<object?, IDuckDBDataWriter[], ulong>)
public void RegisterTableFunction<T1, T2, T3, T4, T5, T6>(string name, Func<IReadOnlyList<IDuckDBValueReader>, TableFunction> resultCallback, Action<object?, IDuckDBDataWriter[], ulong> mapperCallback)
Parameters
namestringresultCallbackFunc<IReadOnly <IDuckList DBValue >, TableReader Function >mapperCallbackAction<object, IDuckDBData [], ulong>Writer
Type Parameters
T1T2T3T4T5T6
RegisterTableFunction<T1, T2, T3, T4, T5, T6, T7>(string, Func<IReadOnlyList<IDuckDBValueReader>, TableFunction>, Action<object?, IDuckDBDataWriter[], ulong>)
public void RegisterTableFunction<T1, T2, T3, T4, T5, T6, T7>(string name, Func<IReadOnlyList<IDuckDBValueReader>, TableFunction> resultCallback, Action<object?, IDuckDBDataWriter[], ulong> mapperCallback)
Parameters
namestringresultCallbackFunc<IReadOnly <IDuckList DBValue >, TableReader Function >mapperCallbackAction<object, IDuckDBData [], ulong>Writer
Type Parameters
T1T2T3T4T5T6T7
RegisterTableFunction<T1, T2, T3, T4, T5, T6, T7, T8>(string, Func<IReadOnlyList<IDuckDBValueReader>, TableFunction>, Action<object?, IDuckDBDataWriter[], ulong>)
public void RegisterTableFunction<T1, T2, T3, T4, T5, T6, T7, T8>(string name, Func<IReadOnlyList<IDuckDBValueReader>, TableFunction> resultCallback, Action<object?, IDuckDBDataWriter[], ulong> mapperCallback)
Parameters
namestringresultCallbackFunc<IReadOnly <IDuckList DBValue >, TableReader Function >mapperCallbackAction<object, IDuckDBData [], ulong>Writer
Type Parameters
T1T2T3T4T5T6T7T8