Class Datasources
Provides methods to interact with datasources, including creation, listing, retrieval, and deletion.
public class Datasources
- Inheritance
-
Datasources
- Inherited Members
Constructors
Datasources(Client)
Initializes a new instance of the Datasources class.
public Datasources(Client client)
Parameters
client
ClientThe client instance for making API requests.
Methods
Create(DatabaseConfig, bool)
Creates a new datasource based on the provided DatabaseConfig.
If the datasource already exists and replace
is true, it will be deleted and replaced.
public Task<Datasource> Create(DatabaseConfig dsConfig, bool replace = false)
Parameters
dsConfig
DatabaseConfigThe database configuration for the datasource to be created.
replace
boolIf true, replaces the existing datasource with the same name, if it exists.
Returns
- Task<Datasource>
A Datasource object representing the created datasource.
Drop(string)
Deletes a datasource by name.
public Task Drop(string name)
Parameters
name
stringThe name of the datasource to delete.
Returns
Get(string)
Retrieves a datasource by name. Throws an exception if the datasource does not support SQL.
public Task<Datasource> Get(string name)
Parameters
name
stringThe name of the datasource to retrieve.
Returns
- Task<Datasource>
A Datasource object representing the retrieved datasource.
Exceptions
- ObjectNotSupportedException
Thrown if the datasource does not support SQL.
List()
Retrieves a list of all available datasources. Filters out datasources that do not support SQL.
public Task<List<Datasource>> List()
Returns
- Task<List<Datasource>>
A list of Datasource objects.