DapperMaticService
Namespace: MJCZone.DapperMatic.AspNetCore.Services
Assembly: MJCZone.DapperMatic.AspNetCore
Summary
What one caller may use of a datasource: the shape every description of it is built from (the caller's OpenAPI document, their GraphQL schema).
Inheritance
Implemented Interfaces:
public
Contents
Constructors (2) | Methods (70)
Constructors
DapperMaticService
Initializes a new instance of the DapperMaticService class.
DapperMaticService(
IDapperMaticDatasourceRepository datasourceRepository,
IDbConnectionFactory connectionFactory,
IDapperMaticPermissions permissions,
IDapperMaticAuditLogger auditLogger)Parameters
- datasourceRepository (IDapperMaticDatasourceRepository) - The datasource repository.
- connectionFactory (IDbConnectionFactory) - The connection factory.
- permissions (IDapperMaticPermissions) - The permissions manager.
- auditLogger (IDapperMaticAuditLogger) - The audit logger.
DapperMaticService
Initializes a new instance of the DapperMaticService class, with the options that declare the relations query requests may follow and the limits on what they may ask for.
DapperMaticService(
IDapperMaticDatasourceRepository datasourceRepository,
IDbConnectionFactory connectionFactory,
IDapperMaticPermissions permissions,
IDapperMaticAuditLogger auditLogger,
DapperMaticOptions} options,
DapperMaticSchemaCache schemaCache,
DapperMaticPolicySet policies,
DapperMaticResultCache resultCache,
DapperMaticChangeLog changeLog,
DapperMaticRealtimeHub hub,
DapperMaticCallerModelCache callerModels)Parameters
- datasourceRepository (IDapperMaticDatasourceRepository) - The datasource repository.
- connectionFactory (IDbConnectionFactory) - The connection factory.
- permissions (IDapperMaticPermissions) - The permissions manager.
- auditLogger (IDapperMaticAuditLogger) - The audit logger.
- options (DapperMaticOptions}) - The options.
- schemaCache (DapperMaticSchemaCache) - The cache of table and view descriptions, or null for one of the service's own.
- policies (DapperMaticPolicySet) - The policies in force, or null for those of the options.
- resultCache (DapperMaticResultCache) - The query results kept for the tables the options list, or null to keep none.
- changeLog (DapperMaticChangeLog) - Where the changes webhooks and subscriptions hear are noted, or null to note none.
- hub (DapperMaticRealtimeHub) - The subscriptions open on this server, told of its changes at once; or null.
- callerModels (DapperMaticCallerModelCache) - The callers' models kept, or null to keep none.
Methods
| Method | Summary |
|---|---|
| GetCheckConstraintsAsync | Gets all check constraints for a table. |
| GetCheckConstraintAsync | Gets a specific check constraint from a table. |
| CreateCheckConstraintAsync | Creates a check constraint on a table. |
| DropCheckConstraintAsync | Drops a check constraint from a table. |
| GetColumnsAsync | Gets all columns from the specified table. |
| GetColumnAsync | Gets a specific column from the table. |
| AddColumnAsync | Adds a new column to an existing table. |
| RenameColumnAsync | Updates an existing column in a table. |
| DropColumnAsync | Drops a column from an existing table. |
| GetDatasourcesAsync | Gets all registered datasources. |
| GetDatasourceAsync | Gets datasource information by name. |
| AddDatasourceAsync | Adds a new datasource. |
| UpdateDatasourceAsync | Updates an existing datasource. |
| RemoveDatasourceAsync | Removes a datasource. |
| DatasourceExistsAsync | Checks if a datasource exists. |
| TestDatasourceAsync | Tests the connection to a datasource. |
| GetDatasourceDataTypesAsync | |
| GetDefaultConstraintsAsync | Gets all default constraints from the specified table. |
| GetDefaultConstraintAsync | Gets a specific default constraint from the table. |
| GetDefaultConstraintOnColumnAsync | Gets a specific default constraint from a table for a column. |
| CreateDefaultConstraintAsync | Creates a new default constraint on a table. |
| DropDefaultConstraintAsync | Drops a default constraint from a table. |
| DropDefaultConstraintOnColumnAsync | Drops a column default constraint from a table. |
| GetForeignKeyConstraintsAsync | Gets all foreign key constraints from the specified table. |
| GetForeignKeyConstraintAsync | Gets a specific foreign key constraint from the table. |
| CreateForeignKeyConstraintAsync | Creates a new foreign key constraint on a table. |
| DropForeignKeyConstraintAsync | Drops a foreign key constraint from a table. |
| ExecuteFunctionAsync | |
| GetIndexesAsync | Gets all indexes from the specified table. |
| GetIndexAsync | Gets a specific index from the table. |
| CreateIndexAsync | Creates a new index on a table. |
| DropIndexAsync | Drops an index from a table. |
| GetOpenApiDocumentAsync | |
| GetPrimaryKeyConstraintAsync | Gets the primary key constraint for a table. |
| CreatePrimaryKeyConstraintAsync | Creates a new primary key constraint on a table. |
| DropPrimaryKeyConstraintAsync | Drops the primary key constraint from a table. |
| InsertTableRowsAsync | |
| UpdateTableRowsAsync | |
| DeleteTableRowsAsync | |
| SaveTableRowsAsync | |
| BatchAsync | |
| GetSchemasAsync | |
| GetSchemaAsync | |
| CreateSchemaAsync | |
| DropSchemaAsync | |
| SchemaExistsAsync | |
| GetTablesAsync | Gets all tables from the specified datasource. |
| GetTableAsync | Gets a specific table from the datasource. |
| CreateTableAsync | Creates a new table in the datasource. |
| UpdateTableAsync | Updates an existing table in the datasource. |
| RenameTableAsync | Renames an existing table in the datasource. |
| DropTableAsync | Drops a table from the datasource. |
| TableExistsAsync | Checks if a table exists in the datasource. |
| QueryTableAsync | Queries a table with filtering, sorting, and pagination. |
| GetUniqueConstraintsAsync | Gets all unique constraints from the specified table. |
| GetUniqueConstraintAsync | Gets a specific unique constraint from the table. |
| CreateUniqueConstraintAsync | Creates a new unique constraint on a table. |
| DropUniqueConstraintAsync | Drops a unique constraint from a table. |
| GetViewsAsync | Gets all views from the specified datasource. |
| GetViewAsync | Gets a specific view from the datasource. |
| CreateViewAsync | Creates a new view in the datasource. |
| UpdateViewAsync | Updates an existing view's properties in the datasource. |
| RenameViewAsync | Renames an existing view in the datasource. |
| DropViewAsync | Drops a view from the datasource. |
| ViewExistsAsync | Checks if a view exists in the datasource. |
| QueryViewAsync | Queries a view with filtering, sorting, and pagination. |
| GetType | |
| ToString | |
| Equals | |
| GetHashCode |
GetCheckConstraintsAsync
Gets all check constraints for a table.
Task<IEnumerable<CheckConstraintDto>> GetCheckConstraintsAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<IEnumerable<CheckConstraintDto>>
List of check constraints for the table.
GetCheckConstraintAsync
Gets a specific check constraint from a table.
Task<CheckConstraintDto> GetCheckConstraintAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string constraintName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- constraintName (string) - The constraint name.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<CheckConstraintDto>
The check constraint if found.
CreateCheckConstraintAsync
Creates a check constraint on a table.
Task<CheckConstraintDto> CreateCheckConstraintAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
CheckConstraintDto checkConstraint,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- checkConstraint (CheckConstraintDto) - The create check constraint request.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<CheckConstraintDto>
The created check constraint.
DropCheckConstraintAsync
Drops a check constraint from a table.
Task DropCheckConstraintAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string constraintName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- constraintName (string) - The constraint name to drop.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task
Task representing the asynchronous operation.
GetColumnsAsync
Gets all columns from the specified table.
Task<IEnumerable<ColumnDto>> GetColumnsAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<IEnumerable<ColumnDto>>
A collection of columns.
GetColumnAsync
Gets a specific column from the table.
Task<ColumnDto> GetColumnAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string columnName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- columnName (string) - The column name.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<ColumnDto>
The column if found, otherwise null.
AddColumnAsync
Adds a new column to an existing table.
Task<ColumnDto> AddColumnAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
ColumnDto column,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- column (ColumnDto) - The add column request.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<ColumnDto>
The added column information if successful, otherwise null.
RenameColumnAsync
Updates an existing column in a table.
Task<ColumnDto> RenameColumnAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string columnName,
string newColumnName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- columnName (string) - The column name to update.
- newColumnName (string) - The new column name.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<ColumnDto>
The updated column information if successful, otherwise null.
DropColumnAsync
Drops a column from an existing table.
Task DropColumnAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string columnName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- columnName (string) - The column name to drop.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task
True if the column was dropped, false if it didn't exist.
GetDatasourcesAsync
Gets all registered datasources.
Task<IEnumerable<DatasourceDto>> GetDatasourcesAsync(
DapperMaticOperation context,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<IEnumerable<DatasourceDto>>
List of datasource information.
GetDatasourceAsync
Gets datasource information by name.
Task<DatasourceDto> GetDatasourceAsync(
DapperMaticOperation context,
string datasourceId,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The id of the datasource.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<DatasourceDto>
The datasource information.
AddDatasourceAsync
Adds a new datasource.
Task<DatasourceDto> AddDatasourceAsync(
DapperMaticOperation context,
DatasourceDto datasource,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasource (DatasourceDto) - The datasource to add.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<DatasourceDto>
The added datasource if successful.
UpdateDatasourceAsync
Updates an existing datasource.
Task<DatasourceDto> UpdateDatasourceAsync(
DapperMaticOperation context,
DatasourceDto datasource,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasource (DatasourceDto) - The updated datasource information.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<DatasourceDto>
The updated datasource.
RemoveDatasourceAsync
Removes a datasource.
Task RemoveDatasourceAsync(
DapperMaticOperation context,
string datasourceId,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The id of the datasource to remove.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task
Task representing the asynchronous operation.
DatasourceExistsAsync
Checks if a datasource exists.
Task<bool> DatasourceExistsAsync(
DapperMaticOperation context,
string datasourceId,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The id of the datasource to check.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<bool>
True if the datasource exists, false otherwise.
TestDatasourceAsync
Tests the connection to a datasource.
Task<DatasourceConnectivityTestDto> TestDatasourceAsync(
DapperMaticOperation context,
string datasourceId,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The id of the datasource to test.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<DatasourceConnectivityTestDto>
Test result containing connection status and details.
GetDatasourceDataTypesAsync
Task<(string, List<DataTypeInfo>)> GetDatasourceDataTypesAsync()Returns
Type: Task<(string, List<DataTypeInfo>)>
GetDefaultConstraintsAsync
Gets all default constraints from the specified table.
Task<IEnumerable<DefaultConstraintDto>> GetDefaultConstraintsAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The ID of the datasource.
- tableName (string) - The name of the table.
- schemaName (string) - The schema name (optional).
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<IEnumerable<DefaultConstraintDto>>
A collection of default constraints.
GetDefaultConstraintAsync
Gets a specific default constraint from the table.
Task<DefaultConstraintDto> GetDefaultConstraintAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string constraintName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The ID of the datasource.
- tableName (string) - The name of the table.
- constraintName (string) - The name of the constraint.
- schemaName (string) - The schema name (optional).
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<DefaultConstraintDto>
The default constraint or null if not found.
GetDefaultConstraintOnColumnAsync
Gets a specific default constraint from a table for a column.
Task<DefaultConstraintDto> GetDefaultConstraintOnColumnAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string columnName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- columnName (string) - The column name.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<DefaultConstraintDto>
The default constraint if found, otherwise null.
CreateDefaultConstraintAsync
Creates a new default constraint on a table.
Task<DefaultConstraintDto> CreateDefaultConstraintAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
DefaultConstraintDto defaultConstraint,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The ID of the datasource.
- tableName (string) - The name of the table.
- defaultConstraint (DefaultConstraintDto) - The default constraint details.
- schemaName (string) - The schema name (optional).
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<DefaultConstraintDto>
The created default constraint.
DropDefaultConstraintAsync
Drops a default constraint from a table.
Task DropDefaultConstraintAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string constraintName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The ID of the datasource.
- tableName (string) - The name of the table.
- constraintName (string) - The name of the constraint.
- schemaName (string) - The schema name (optional).
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task
A task representing the asynchronous operation.
DropDefaultConstraintOnColumnAsync
Drops a column default constraint from a table.
Task DropDefaultConstraintOnColumnAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string columnName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- columnName (string) - The column name to drop the constraint from.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task
Task representing the asynchronous operation.
GetForeignKeyConstraintsAsync
Gets all foreign key constraints from the specified table.
Task<IEnumerable<ForeignKeyConstraintDto>> GetForeignKeyConstraintsAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The ID of the datasource.
- tableName (string) - The name of the table.
- schemaName (string) - The schema name (optional).
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<IEnumerable<ForeignKeyConstraintDto>>
A collection of foreign key constraints.
GetForeignKeyConstraintAsync
Gets a specific foreign key constraint from the table.
Task<ForeignKeyConstraintDto> GetForeignKeyConstraintAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string constraintName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The ID of the datasource.
- tableName (string) - The name of the table.
- constraintName (string) - The name of the constraint.
- schemaName (string) - The schema name (optional).
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<ForeignKeyConstraintDto>
The foreign key constraint or null if not found.
CreateForeignKeyConstraintAsync
Creates a new foreign key constraint on a table.
Task<ForeignKeyConstraintDto> CreateForeignKeyConstraintAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
ForeignKeyConstraintDto foreignKeyConstraint,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The ID of the datasource.
- tableName (string) - The name of the table.
- foreignKeyConstraint (ForeignKeyConstraintDto) - The foreign key constraint details.
- schemaName (string) - The schema name (optional).
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<ForeignKeyConstraintDto>
The created foreign key constraint.
DropForeignKeyConstraintAsync
Drops a foreign key constraint from a table.
Task DropForeignKeyConstraintAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string constraintName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The ID of the datasource.
- tableName (string) - The name of the table.
- constraintName (string) - The name of the constraint.
- schemaName (string) - The schema name (optional).
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task
A task representing the asynchronous operation.
ExecuteFunctionAsync
Task<FunctionResponse> ExecuteFunctionAsync()Returns
Type: Task<FunctionResponse>
GetIndexesAsync
Gets all indexes from the specified table.
Task<IEnumerable<IndexDto>> GetIndexesAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<IEnumerable<IndexDto>>
A collection of indexes.
GetIndexAsync
Gets a specific index from the table.
Task<IndexDto> GetIndexAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string indexName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- indexName (string) - The index name.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<IndexDto>
The index if found, otherwise null.
CreateIndexAsync
Creates a new index on a table.
Task<IndexDto> CreateIndexAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
IndexDto index,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- index (IndexDto) - The index details.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<IndexDto>
The created index.
DropIndexAsync
Drops an index from a table.
Task DropIndexAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string indexName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- indexName (string) - The index name to drop.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task
A task representing the asynchronous operation.
GetOpenApiDocumentAsync
Task<JsonObject> GetOpenApiDocumentAsync()Returns
Type: Task<JsonObject>
GetPrimaryKeyConstraintAsync
Gets the primary key constraint for a table.
Task<PrimaryKeyConstraintDto?> GetPrimaryKeyConstraintAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<PrimaryKeyConstraintDto?>
The primary key constraint or null if the table does not have a primary key.
CreatePrimaryKeyConstraintAsync
Creates a new primary key constraint on a table.
Task<PrimaryKeyConstraintDto> CreatePrimaryKeyConstraintAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
PrimaryKeyConstraintDto primaryKeyConstraint,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The ID of the datasource.
- tableName (string) - The name of the table.
- primaryKeyConstraint (PrimaryKeyConstraintDto) - The primary key constraint details.
- schemaName (string) - The schema name (optional).
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<PrimaryKeyConstraintDto>
The created primary key constraint.
DropPrimaryKeyConstraintAsync
Drops the primary key constraint from a table.
Task DropPrimaryKeyConstraintAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The ID of the datasource.
- tableName (string) - The name of the table.
- schemaName (string) - The schema name (optional).
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task
A task representing the asynchronous operation.
InsertTableRowsAsync
Task<int> InsertTableRowsAsync()Returns
Type: Task<int>
UpdateTableRowsAsync
Task<int> UpdateTableRowsAsync()Returns
Type: Task<int>
DeleteTableRowsAsync
Task<int> DeleteTableRowsAsync()Returns
Type: Task<int>
SaveTableRowsAsync
Task<RowsResponse> SaveTableRowsAsync()Returns
Type: Task<RowsResponse>
BatchAsync
Task<BatchResponse> BatchAsync()Returns
Type: Task<BatchResponse>
GetSchemasAsync
Task<IEnumerable<SchemaDto>> GetSchemasAsync()Returns
Type: Task<IEnumerable<SchemaDto>>
GetSchemaAsync
Task<SchemaDto> GetSchemaAsync()Returns
Type: Task<SchemaDto>
CreateSchemaAsync
Task<SchemaDto> CreateSchemaAsync()Returns
Type: Task<SchemaDto>
DropSchemaAsync
Task DropSchemaAsync()Returns
Type: Task
SchemaExistsAsync
Task<bool> SchemaExistsAsync()Returns
Type: Task<bool>
GetTablesAsync
Gets all tables from the specified datasource.
Task<IEnumerable<TableDto>> GetTablesAsync(
DapperMaticOperation context,
string datasourceId,
string schemaName,
bool includeColumns,
bool includeIndexes,
bool includeConstraints,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- schemaName (string) - Optional schema name filter.
- includeColumns (bool) - Whether to include column information.
- includeIndexes (bool) - Whether to include index information.
- includeConstraints (bool) - Whether to include constraint information.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<IEnumerable<TableDto>>
A collection of tables.
GetTableAsync
Gets a specific table from the datasource.
Task<TableDto> GetTableAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string schemaName,
bool includeColumns,
bool includeIndexes,
bool includeConstraints,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- schemaName (string) - Optional schema name.
- includeColumns (bool) - Whether to include column information.
- includeIndexes (bool) - Whether to include index information.
- includeConstraints (bool) - Whether to include constraint information.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<TableDto>
The table.
CreateTableAsync
Creates a new table in the datasource.
Task<TableDto> CreateTableAsync(
DapperMaticOperation context,
string datasourceId,
TableDto table,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- table (TableDto) - The table information.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<TableDto>
The created table.
UpdateTableAsync
Updates an existing table in the datasource.
Task<TableDto> UpdateTableAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
TableDto updates,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The name of the table to update.
- updates (TableDto) - The table updates.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<TableDto>
The updated table.
RenameTableAsync
Renames an existing table in the datasource.
Task<TableDto> RenameTableAsync(
DapperMaticOperation context,
string datasourceId,
string currentTableName,
string newTableName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- currentTableName (string) - The current name of the table.
- newTableName (string) - The new name for the table.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<TableDto>
The renamed table.
DropTableAsync
Drops a table from the datasource.
Task DropTableAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The name of the table to drop.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task
A task representing the asynchronous operation.
TableExistsAsync
Checks if a table exists in the datasource.
Task<bool> TableExistsAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<bool>
True if the table exists, otherwise false.
QueryTableAsync
Queries a table with filtering, sorting, and pagination.
Task<QueryResultDto> QueryTableAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
QueryDto request,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- tableName (string) - The table name to query.
- request (QueryDto) - The query parameters.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<QueryResultDto>
The query results with pagination information.
GetUniqueConstraintsAsync
Gets all unique constraints from the specified table.
Task<IEnumerable<UniqueConstraintDto>> GetUniqueConstraintsAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The ID of the datasource.
- tableName (string) - The name of the table.
- schemaName (string) - The schema name (optional).
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<IEnumerable<UniqueConstraintDto>>
A collection of unique constraints.
GetUniqueConstraintAsync
Gets a specific unique constraint from the table.
Task<UniqueConstraintDto> GetUniqueConstraintAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string constraintName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The ID of the datasource.
- tableName (string) - The name of the table.
- constraintName (string) - The name of the constraint.
- schemaName (string) - The schema name (optional).
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<UniqueConstraintDto>
The unique constraint or null if not found.
CreateUniqueConstraintAsync
Creates a new unique constraint on a table.
Task<UniqueConstraintDto> CreateUniqueConstraintAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
UniqueConstraintDto uniqueConstraint,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The ID of the datasource.
- tableName (string) - The name of the table.
- uniqueConstraint (UniqueConstraintDto) - The request containing unique constraint details.
- schemaName (string) - The schema name (optional).
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<UniqueConstraintDto>
The created unique constraint or null if creation failed.
DropUniqueConstraintAsync
Drops a unique constraint from a table.
Task DropUniqueConstraintAsync(
DapperMaticOperation context,
string datasourceId,
string tableName,
string constraintName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The ID of the datasource.
- tableName (string) - The name of the table.
- constraintName (string) - The name of the constraint.
- schemaName (string) - The schema name (optional).
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task
True if the unique constraint was dropped successfully, false otherwise.
GetViewsAsync
Gets all views from the specified datasource.
Task<IEnumerable<ViewDto>> GetViewsAsync(
DapperMaticOperation context,
string datasourceId,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- schemaName (string) - Optional schema name filter.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<IEnumerable<ViewDto>>
A collection of views.
GetViewAsync
Gets a specific view from the datasource.
Task<ViewDto> GetViewAsync(
DapperMaticOperation context,
string datasourceId,
string viewName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- viewName (string) - The view name.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<ViewDto>
The view.
CreateViewAsync
Creates a new view in the datasource.
Task<ViewDto> CreateViewAsync(
DapperMaticOperation context,
string datasourceId,
ViewDto view,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- view (ViewDto) - The view data transfer object containing the view information.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<ViewDto>
The created view.
UpdateViewAsync
Updates an existing view's properties in the datasource.
Task<ViewDto> UpdateViewAsync(
DapperMaticOperation context,
string datasourceId,
string viewName,
ViewDto updates,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- viewName (string) - The name of the view to update.
- updates (ViewDto) - The view updates (only non-null properties will be updated).
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<ViewDto>
The updated view.
RenameViewAsync
Renames an existing view in the datasource.
Task<ViewDto> RenameViewAsync(
DapperMaticOperation context,
string datasourceId,
string currentViewName,
string newViewName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- currentViewName (string) - The current name of the view.
- newViewName (string) - The new name for the view.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<ViewDto>
The renamed view.
DropViewAsync
Drops a view from the datasource.
Task DropViewAsync(
DapperMaticOperation context,
string datasourceId,
string viewName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- viewName (string) - The name of the view to drop.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task
A task representing the asynchronous operation.
ViewExistsAsync
Checks if a view exists in the datasource.
Task<bool> ViewExistsAsync(
DapperMaticOperation context,
string datasourceId,
string viewName,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- viewName (string) - The view name.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<bool>
True if the view exists, otherwise false.
QueryViewAsync
Queries a view with filtering, sorting, and pagination.
Task<QueryResultDto> QueryViewAsync(
DapperMaticOperation context,
string datasourceId,
string viewName,
QueryDto request,
string schemaName,
CancellationToken cancellationToken)Parameters
- context (DapperMaticOperation) - The operation context.
- datasourceId (string) - The datasource identifier.
- viewName (string) - The view name to query.
- request (QueryDto) - The query parameters.
- schemaName (string) - Optional schema name.
- cancellationToken (CancellationToken) - The cancellation token.
Returns
Type: Task<QueryResultDto>
The query results with pagination information.
GetType
GetType()ToString
ToString()Equals
Equals()GetHashCode
GetHashCode()