Class DuckDbEnumDictionary
Retrieves the names of the members in a DuckDB enumeration.
Implements
Inherited Members
Namespace: Mallard
Assembly: Mallard.dll
Syntax
public sealed class DuckDbEnumDictionary : IReadOnlyDictionary<uint, string>, IReadOnlyCollection<KeyValuePair<uint, string>>, IEnumerable<KeyValuePair<uint, string>>, IEnumerable, IDisposable
Remarks
The names may be retrieved on-demand from DuckDB, since the enumeration may be quite large yet most of its members may not be used in a particular query's results. Thus this class holds a native resource (handle to a DuckDB logical type) and is disposable.
Properties
| Edit this page View SourceCount
Gets the number of elements in the collection.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int | The number of elements in the collection. |
this[uint]
Get the string corresponding to an enumeration value.
Declaration
public string this[uint key] { get; }
Parameters
Type | Name | Description |
---|---|---|
uint | key | The enumeration value. |
Property Value
Type | Description |
---|---|
string | The string associated to the enumeration value when the enumeration was defined in DuckDB. |
Keys
Gets an enumerable collection that contains the keys in the read-only dictionary.
Declaration
public IEnumerable<uint> Keys { get; }
Property Value
Type | Description |
---|---|
IEnumerable<uint> | An enumerable collection that contains the keys in the read-only dictionary. |
Values
Gets an enumerable collection that contains the values in the read-only dictionary.
Declaration
public IEnumerable<string> Values { get; }
Property Value
Type | Description |
---|---|
IEnumerable<string> | An enumerable collection that contains the values in the read-only dictionary. |
Methods
| Edit this page View SourceContainsKey(uint)
Determines whether the read-only dictionary contains an element that has the specified key.
Declaration
public bool ContainsKey(uint key)
Parameters
Type | Name | Description |
---|---|---|
uint | key | The key to locate. |
Returns
Type | Description |
---|---|
bool | true if the read-only dictionary contains an element that has the specified key; otherwise, false. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Dispose()
Disposes the resource held from the natice DuckDB library, if any exists currently, used to query the enumeration members.
Declaration
public void Dispose()
Remarks
After calling this method, this instance should not be used again.
~DuckDbEnumDictionary()
Declaration
protected ~DuckDbEnumDictionary()
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<KeyValuePair<uint, string>> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<KeyValuePair<uint, string>> | An enumerator that can be used to iterate through the collection. |
TryGetValue(uint, out string)
Gets the value that is associated with the specified key.
Declaration
public bool TryGetValue(uint key, out string value)
Parameters
Type | Name | Description |
---|---|---|
uint | key | The key to locate. |
string | value | When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the |
Returns
Type | Description |
---|---|
bool | true if the object that implements the IReadOnlyDictionary<TKey, TValue> interface contains an element that has the specified key; otherwise, false. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|