Class DuckDBCommand
- Inheritance
-
Duck
DBCommand
- Implements
- Inherited Members
Constructors
DuckDBCommand()
DuckDBCommand(string)
Parameters
commandText
string
DuckDBCommand(string, DuckDBConnection)
Parameters
commandText
stringconnection
DuckDBConnection
Properties
CommandText
Gets or sets the text command to run against the data source.
Property Value
- string
The text command to execute. The default value is an empty string ("").
CommandTimeout
Gets or sets the wait time (in seconds) before terminating the attempt to execute the command and generating an error.
Property Value
- int
The time in seconds to wait for the command to execute.
CommandType
Gets or sets how the Command
Property Value
- Command
Type One of the enumeration values that specifies how a command string is interpreted. The default is
Text
.
DbConnection
Gets or sets the Db
Property Value
- Db
Connection The connection to the data source.
DbParameterCollection
Gets the collection of Db
Property Value
- Db
Parameter Collection The parameters of the SQL statement or stored procedure.
DbTransaction
Gets or sets the Db
Property Value
- Db
Transaction The transaction within which a command object of a .NET data provider executes. The default value is a null reference (
Nothing
in Visual Basic).
DesignTimeVisible
Gets or sets a value indicating whether the command object should be visible in a customized interface control.
Property Value
- bool
true, if the command object should be visible in a control; otherwise false. The default is true.
Parameters
Property Value
UpdatedRowSource
Gets or sets how command results are applied to the Data
Property Value
- Update
Row Source One of the enumeration values that indicates how command results are applied. The default is
Both
unless the command is automatically generated. Then the default isNone
.
UseStreamingMode
A flag to determine whether to use streaming mode or not when executing a query. Defaults to false. In streaming mode DuckDB will use less RAM but query execution might be slower. Applies only to queries that return a result-set.
Property Value
Remarks
Streaming mode uses duckdb_execute_prepared_streaming
and duckdb_stream_fetch_chunk
, non-streaming (materialized) mode uses duckdb_execute_prepared
and duckdb_result_get_chunk
.
Methods
Cancel()
Attempts to cancel the execution of a Db
CreateDbParameter()
Creates a new instance of a Db
Returns
- Db
Parameter A Db
Parameter object.
ExecuteDbDataReader(CommandBehavior)
Executes the command against its connection, returning a Db
Parameters
behavior
CommandBehavior An instance of Command
Behavior , specifying options for command execution and data retrieval.
Returns
- Db
Data Reader A Db
Data object.Reader
Exceptions
- Db
Exception An error occurred while executing the command.
- Argument
Exception An invalid Command
Behavior value.
ExecuteNonQuery()
Executes the command against its connection object, returning the number of rows affected.
Returns
- int
The number of rows affected.
ExecuteReader()
Returns
ExecuteReader(CommandBehavior)
Parameters
behavior
CommandBehavior
Returns
ExecuteScalar()
Executes the command and returns the first column of the first row in the first returned result set. All other columns, rows and result sets are ignored.
Returns
- object
The first column of the first row in the first result set.
Prepare()
Creates a prepared (or compiled) version of the command on the data source.