Class DuckDBConnectionStringBuilder
public class DuckDBConnectionStringBuilder : DbConnectionStringBuilder, IDictionary, ICollection, IEnumerable, ICustomTypeDescriptor
- Inheritance
-
DuckDBConnectionStringBuilder
- Implements
- Inherited Members
Fields
InMemoryConnectionString
public const string InMemoryConnectionString = "DataSource=:memory:"
Field Value
InMemoryDataSource
public const string InMemoryDataSource = ":memory:"
Field Value
InMemorySharedConnectionString
public const string InMemorySharedConnectionString = "DataSource=:memory:?cache=shared"
Field Value
InMemorySharedDataSource
public const string InMemorySharedDataSource = ":memory:?cache=shared"
Field Value
Properties
AccessMode
Access mode of the database. null leaves the option unset, so DuckDB's own default applies.
public DuckDBAccessMode? AccessMode { get; set; }
Property Value
AllowCommunityExtensions
Whether community-built extensions may be loaded.
public bool? AllowCommunityExtensions { get; set; }
Property Value
- bool?
AllowPersistentSecrets
Whether persistent secrets, which are stored on disk and reloaded on restart, may be created.
public bool? AllowPersistentSecrets { get; set; }
Property Value
- bool?
AllowUnsignedExtensions
Whether extensions with an invalid or missing signature may be loaded.
public bool? AllowUnsignedExtensions { get; set; }
Property Value
- bool?
AutoinstallKnownExtensions
Whether known extensions may be installed automatically when a query depends on them.
public bool? AutoinstallKnownExtensions { get; set; }
Property Value
- bool?
AutoloadKnownExtensions
Whether known extensions may be loaded automatically when a query depends on them.
public bool? AutoloadKnownExtensions { get; set; }
Property Value
- bool?
CheckpointThreshold
The write-ahead log size threshold at which a checkpoint is triggered automatically, for example 1GB.
public string CheckpointThreshold { get; set; }
Property Value
CustomExtensionRepository
Overrides the endpoint used for remote extension installation.
public string CustomExtensionRepository { get; set; }
Property Value
CustomUserAgent
Metadata identifying the calling application, reported to DuckDB alongside the driver's own identifier.
public string CustomUserAgent { get; set; }
Property Value
DataSource
public string DataSource { get; set; }
Property Value
DefaultCollation
The collation used when none is specified.
public string DefaultCollation { get; set; }
Property Value
DefaultNullOrder
The NULL ordering used when an ORDER BY clause does not specify one.
public DuckDBNullOrder? DefaultNullOrder { get; set; }
Property Value
DefaultOrder
The sort order used when an ORDER BY clause does not specify one.
public DuckDBSortOrder? DefaultOrder { get; set; }
Property Value
EnableExternalAccess
Whether the database may access external state such as files, extensions and remote endpoints.
public bool? EnableExternalAccess { get; set; }
Property Value
- bool?
ErrorsAsJson
Whether error messages are produced as structured JSON instead of a raw string.
public bool? ErrorsAsJson { get; set; }
Property Value
- bool?
ExtensionDirectory
The directory in which extensions are stored.
public string ExtensionDirectory { get; set; }
Property Value
ExternalThreads
The number of external threads that work on DuckDB tasks.
public int? ExternalThreads { get; set; }
Property Value
- int?
this[string]
Gets or sets the value associated with the specified key.
[AllowNull]
public override object this[string keyword] { get; set; }
Parameters
keywordstringThe key of the item to get or set.
Property Value
- object
The value associated with the specified key. If the specified key is not found, trying to get it returns a null reference (
Nothingin Visual Basic), and trying to set it creates a new element using the specified key.Passing a null (
Nothingin Visual Basic) key throws an ArgumentNullException. Assigning a null value removes the key/value pair.
Exceptions
- ArgumentNullException
keywordis a null reference (Nothingin Visual Basic).- NotSupportedException
The property is set, and the DbConnectionStringBuilder is read-only.
-or-
The property is set,
keyworddoes not exist in the collection, and the DbConnectionStringBuilder has a fixed size.
LockConfiguration
Whether configuration options can still be altered after the database has been opened.
public bool? LockConfiguration { get; set; }
Property Value
- bool?
MaxTempDirectorySize
The maximum amount of data stored inside TempDirectory, for example 1GB.
public string MaxTempDirectorySize { get; set; }
Property Value
MemoryLimit
The maximum memory the system may use, for example 1GB.
public string MemoryLimit { get; set; }
Property Value
PreserveInsertionOrder
Whether insertion order is preserved. Setting this to false lets DuckDB re-order
results that have no ORDER BY clause, which can reduce memory usage.
public bool? PreserveInsertionOrder { get; set; }
Property Value
- bool?
SecretDirectory
The directory to which persistent secrets are stored.
public string SecretDirectory { get; set; }
Property Value
StorageCompatibilityVersion
Serialize on checkpoint with storage compatibility for the given DuckDB version, for example v0.10.2.
public string StorageCompatibilityVersion { get; set; }
Property Value
TempDirectory
The directory to which temporary files are written when data does not fit in memory.
public string TempDirectory { get; set; }
Property Value
Threads
The total number of threads used by the system. DuckDB rejects zero and negative values.
public int? Threads { get; set; }
Property Value
- int?
Methods
ContainsKey(string)
Determines whether the DbConnectionStringBuilder contains a specific key.
public override bool ContainsKey(string keyword)
Parameters
keywordstringThe key to locate in the DbConnectionStringBuilder.
Returns
- bool
true if the DbConnectionStringBuilder contains an entry with the specified key; otherwise false.
Exceptions
- ArgumentNullException
keywordis a null reference (Nothingin Visual Basic).
GetProperties(Hashtable)
Adds a descriptor for every DuckDB configuration option that does not already have a typed property, so that property grids and other TypeDescriptor consumers can discover the full option set of the native library actually in use.
protected override void GetProperties(Hashtable propertyDescriptors)
Parameters
propertyDescriptorsHashtable
Remove(string)
Removes the entry with the specified key from the DbConnectionStringBuilder instance.
public override bool Remove(string keyword)
Parameters
keywordstringThe key of the key/value pair to be removed from the connection string in this DbConnectionStringBuilder.
Returns
- bool
true if the key existed within the connection string and was removed; false if the key did not exist.
Exceptions
- ArgumentNullException
keywordis null (Nothingin Visual Basic)- NotSupportedException
The DbConnectionStringBuilder is read-only, or the DbConnectionStringBuilder has a fixed size.
ShouldSerialize(string)
Indicates whether the specified key exists in this DbConnectionStringBuilder instance.
public override bool ShouldSerialize(string keyword)
Parameters
keywordstringThe key to locate in the DbConnectionStringBuilder.
Returns
- bool
true if the DbConnectionStringBuilder contains an entry with the specified key; otherwise false.
TryGetValue(string, out object?)
Retrieves a value corresponding to the supplied key from this DbConnectionStringBuilder.
public override bool TryGetValue(string keyword, out object? value)
Parameters
keywordstringThe key of the item to retrieve.
valueobjectThe value corresponding to the
keyword.
Returns
Exceptions
- ArgumentNullException
keywordcontains a null value (Nothingin Visual Basic).