Interface IDatabaseAdmin
Defines administrative operations for a database, including keyspace management and discovery of embedding and reranking providers.
public interface IDatabaseAdmin
Methods
CreateKeyspace(string, CreateKeyspaceOptions)
Synchronous version of CreateKeyspaceAsync(string, CreateKeyspaceOptions)
void CreateKeyspace(string keyspace, CreateKeyspaceOptions options = null)
Parameters
keyspacestringThe name of the keyspace to create.
optionsCreateKeyspaceOptionsOptional settings that influence request execution.
Examples
await admin.CreateKeyspaceAsync("myKeyspace");
Remarks
This method, by default, will wait for the operation to complete on the server side. Use the options' waitForCompletion attribute to control this behaviour.
CreateKeyspaceAsync(string, CreateKeyspaceOptions)
Creates a new keyspace with the specified name.
Task CreateKeyspaceAsync(string keyspace, CreateKeyspaceOptions options = null)
Parameters
keyspacestringThe name of the keyspace to create.
optionsCreateKeyspaceOptionsOptional settings that influence request execution.
Returns
Examples
await admin.CreateKeyspaceAsync("myKeyspace");
Remarks
This method, by default, will wait for the operation to complete on the server side. Use the options' waitForCompletion attribute to control this behaviour.
DoesKeyspaceExist(string, DoesKeyspaceExistOptions)
Synchronous version of DoesKeyspaceExistAsync(string, DoesKeyspaceExistOptions).
bool DoesKeyspaceExist(string keyspace, DoesKeyspaceExistOptions options = null)
Parameters
keyspacestringThe name of the keyspace to check.
optionsDoesKeyspaceExistOptionsOptional settings that influence request execution.
Returns
- bool
A task that resolves to
trueif the keyspace exists; otherwise,false.
Examples
bool exists = await admin.DoesKeyspaceExistAsync("myKeyspace");
bool exists = admin.DoesKeyspaceExist("myKeyspace");
DoesKeyspaceExistAsync(string, DoesKeyspaceExistOptions)
Checks whether a keyspace with the specified name exists.
Task<bool> DoesKeyspaceExistAsync(string keyspace, DoesKeyspaceExistOptions options = null)
Parameters
keyspacestringThe name of the keyspace to check.
optionsDoesKeyspaceExistOptionsOptional settings that influence request execution.
Returns
Examples
bool exists = await admin.DoesKeyspaceExistAsync("myKeyspace");
DropKeyspace(string, DropKeyspaceOptions)
Synchronous version of DropKeyspaceAsync(string, DropKeyspaceOptions).
void DropKeyspace(string keyspace, DropKeyspaceOptions options = null)
Parameters
keyspacestringThe name of the keyspace to drop.
optionsDropKeyspaceOptionsOptional settings that influence request execution.
Examples
await admin.DropKeyspaceAsync("myKeyspace", options);
DropKeyspaceAsync(string, DropKeyspaceOptions)
Drops the keyspace with the specified name.
Task DropKeyspaceAsync(string keyspace, DropKeyspaceOptions options = null)
Parameters
keyspacestringThe name of the keyspace to drop.
optionsDropKeyspaceOptionsOptional settings that influence request execution.
Returns
Examples
await admin.DropKeyspaceAsync("myKeyspace", options);
FindEmbeddingProviders(FindEmbeddingProvidersOptions)
Synchronous version of FindEmbeddingProvidersAsync(FindEmbeddingProvidersOptions).
FindEmbeddingProvidersResult FindEmbeddingProviders(FindEmbeddingProvidersOptions options = null)
Parameters
optionsFindEmbeddingProvidersOptionsOptional settings that influence request execution.
Returns
- FindEmbeddingProvidersResult
A FindEmbeddingProvidersResult containing the discovered providers.
Examples
var providers = await admin.FindEmbeddingProvidersAsync();
var providers = admin.FindEmbeddingProviders();
FindEmbeddingProvidersAsync(FindEmbeddingProvidersOptions)
Finds and returns available embedding providers for the current database.
Task<FindEmbeddingProvidersResult> FindEmbeddingProvidersAsync(FindEmbeddingProvidersOptions options = null)
Parameters
optionsFindEmbeddingProvidersOptionsOptional settings that influence request execution.
Returns
- Task<FindEmbeddingProvidersResult>
A FindEmbeddingProvidersResult containing the discovered providers.
Examples
var providers = await admin.FindEmbeddingProvidersAsync();
FindRerankingProviders(FindRerankingProvidersOptions)
Synchronous version of FindRerankingProvidersAsync(FindRerankingProvidersOptions).
FindRerankingProvidersResult FindRerankingProviders(FindRerankingProvidersOptions options = null)
Parameters
optionsFindRerankingProvidersOptionsOptional settings that influence request execution.
Returns
- FindRerankingProvidersResult
A FindRerankingProvidersResult containing the discovered providers.
Examples
var providers = await admin.FindRerankingProvidersAsync();
var providers = admin.FindRerankingProviders();
FindRerankingProvidersAsync(FindRerankingProvidersOptions)
Finds and returns available reranking providers for the current database.
Task<FindRerankingProvidersResult> FindRerankingProvidersAsync(FindRerankingProvidersOptions options = null)
Parameters
optionsFindRerankingProvidersOptionsOptional settings that influence request execution.
Returns
- Task<FindRerankingProvidersResult>
A FindRerankingProvidersResult containing the discovered providers.
Examples
var providers = await admin.FindRerankingProvidersAsync();
GetDatabase(GetDatabaseOptions)
Returns a Database instance for non-admin usage.
Database GetDatabase(GetDatabaseOptions options = null)
Parameters
optionsGetDatabaseOptionsoptions for the returned database: useful to override timeouts and other behavior.
Returns
Examples
var database = admin.GetDatabase("myToken");
GetDatabase(string, GetDatabaseOptions)
Returns a Database instance for non-admin usage.
Database GetDatabase(string token, GetDatabaseOptions options = null)
Parameters
tokenstringThe token that will be used by the database. Omit to keep using the current token.
optionsGetDatabaseOptionsoptions for the returned database: useful to override timeouts and other behavior.
Returns
Examples
var database = admin.GetDatabase("myToken");
ListKeyspaces(ListKeyspacesOptions)
Synchronous version of ListKeyspacesAsync(ListKeyspacesOptions).
IEnumerable<string> ListKeyspaces(ListKeyspacesOptions options = null)
Parameters
optionsListKeyspacesOptionsOptional settings that influence request execution.
Returns
- IEnumerable<string>
A collection of keyspace names.
Examples
var keyspaces = await admin.ListKeyspacesAsync();
IEnumerable<string> keyspaces = admin.ListKeyspaces();
ListKeyspacesAsync(ListKeyspacesOptions)
Lists the names of all keyspaces in the database.
Task<IEnumerable<string>> ListKeyspacesAsync(ListKeyspacesOptions options = null)
Parameters
optionsListKeyspacesOptionsOptional settings that influence request execution.
Returns
- Task<IEnumerable<string>>
A collection of keyspace names.
Examples
var keyspaces = await admin.ListKeyspacesAsync();