Skip to content

IDapperMaticService ​

Namespace: MJCZone.DapperMatic.AspNetCore.Services

Assembly: MJCZone.DapperMatic.AspNetCore

Summary ​

Service interface for DapperMatic operations in ASP.NET Core applications.

abstract public

Note: This is an interface that defines a contract. Look for implementing classes in the same or related namespaces.

Contents ​

Methods (66)

Methods ​

MethodSummary
GetDatasourcesAsyncGets all registered datasources.
GetDatasourceAsyncGets datasource information by name.
AddDatasourceAsyncAdds a new datasource.
UpdateDatasourceAsyncUpdates an existing datasource.
RemoveDatasourceAsyncRemoves a datasource.
DatasourceExistsAsyncChecks if a datasource exists.
TestDatasourceAsyncTests the connection to a datasource.
GetSchemasAsyncGets all schemas from the specified datasource.
GetSchemaAsyncGets a specific schema from the specified datasource.
CreateSchemaAsyncCreates a new schema in the specified datasource.
DropSchemaAsyncDrops a schema from the specified datasource.
SchemaExistsAsyncChecks if a schema exists in the specified datasource.
GetViewsAsyncGets all views from the specified datasource.
GetViewAsyncGets a specific view from the datasource.
CreateViewAsyncCreates a new view in the datasource.
UpdateViewAsyncUpdates an existing view's properties in the datasource.
RenameViewAsyncRenames an existing view in the datasource.
DropViewAsyncDrops a view from the datasource.
ViewExistsAsyncChecks if a view exists in the datasource.
QueryViewAsyncQueries a view with filtering, sorting, and pagination.
GetDatasourceDataTypesAsyncGets all available data types for a specific datasource.
GetTablesAsyncGets all tables from the specified datasource.
GetTableAsyncGets a specific table from the datasource.
CreateTableAsyncCreates a new table in the datasource.
DropTableAsyncDrops a table from the datasource.
TableExistsAsyncChecks if a table exists in the datasource.
InsertTableRowsAsyncInserts rows into a table, all or none, each value converted to its column's type.
UpdateTableRowsAsyncSets columns of the rows of a table that match a condition.
DeleteTableRowsAsyncDeletes the rows of a table that match a condition.
SaveTableRowsAsyncWrites rows of a table with the rows they relate to, through declared relations, all or none: a rela...
BatchAsyncRuns writes of rows of a datasource's tables in order, in one transaction, all or none: each authori...
GetOpenApiDocumentAsyncDescribes a datasource's rows as the caller may use them, in an OpenAPI 3.1 document: the tables and...
ExecuteFunctionAsyncRuns a function the application declares in Functions, as policies granting Execute allow: its a...
QueryTableAsyncQueries a table with filtering, sorting, and pagination.
UpdateTableAsyncUpdates an existing table in the datasource.
RenameTableAsyncRenames an existing table in the datasource.
GetColumnsAsyncGets all columns for a specific table.
GetColumnAsyncGets a specific column from a table.
AddColumnAsyncAdds a new column to an existing table.
RenameColumnAsyncUpdates an existing column in a table.
DropColumnAsyncDrops a column from a table.
GetIndexesAsyncGets all indexes for a specific table.
GetIndexAsyncGets a specific index from a table.
CreateIndexAsyncCreates a new index on a table.
DropIndexAsyncDrops an index from a table.
GetPrimaryKeyConstraintAsyncGets the primary key constraint for a table.
CreatePrimaryKeyConstraintAsyncCreates a primary key constraint on a table.
DropPrimaryKeyConstraintAsyncDrops the primary key constraint from a table.
GetForeignKeyConstraintsAsyncGets all foreign key constraints for a table.
GetForeignKeyConstraintAsyncGets a specific foreign key constraint from a table.
CreateForeignKeyConstraintAsyncCreates a foreign key constraint on a table.
DropForeignKeyConstraintAsyncDrops a foreign key constraint from a table.
GetCheckConstraintsAsyncGets all check constraints for a table.
GetCheckConstraintAsyncGets a specific check constraint from a table.
CreateCheckConstraintAsyncCreates a check constraint on a table.
DropCheckConstraintAsyncDrops a check constraint from a table.
GetUniqueConstraintsAsyncGets all unique constraints for a table.
GetUniqueConstraintAsyncGets a specific unique constraint from a table.
CreateUniqueConstraintAsyncCreates a unique constraint on a table.
DropUniqueConstraintAsyncDrops a unique constraint from a table.
GetDefaultConstraintsAsyncGets all default constraints for a table.
GetDefaultConstraintAsyncGets a specific default constraint from a table.
GetDefaultConstraintOnColumnAsyncGets a specific default constraint from a table for a column.
CreateDefaultConstraintAsyncCreates a default constraint on a table.
DropDefaultConstraintAsyncDrops a default constraint from a table.
DropDefaultConstraintOnColumnAsyncDrops a column default constraint from a table.

GetDatasourcesAsync ​

Gets all registered datasources.

csharp
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.

csharp
Task&lt;DatasourceDto&gt; 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.

csharp
Task&lt;DatasourceDto&gt; 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.

csharp
Task&lt;DatasourceDto&gt; 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.

csharp
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.

csharp
Task&lt;bool&gt; 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&lt;bool&gt;

True if the datasource exists, false otherwise.

TestDatasourceAsync ​

Tests the connection to a datasource.

csharp
Task&lt;DatasourceConnectivityTestDto&gt; 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.

GetSchemasAsync ​

Gets all schemas from the specified datasource.

csharp
Task&lt;IEnumerable&lt;SchemaDto&gt;&gt; GetSchemasAsync(
    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<IEnumerable<SchemaDto>>

List of schemas.

GetSchemaAsync ​

Gets a specific schema from the specified datasource.

csharp
Task&lt;SchemaDto&gt; GetSchemaAsync(
    DapperMaticOperation context,
    string datasourceId,
    string schemaName,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation context.
  • datasourceId (string) - The id of the datasource.
  • schemaName (string) - The schema name.
  • cancellationToken (CancellationToken) - Cancellation token.

Returns ​

Type: Task<SchemaDto>

The schema if found.

CreateSchemaAsync ​

Creates a new schema in the specified datasource.

csharp
Task&lt;SchemaDto&gt; CreateSchemaAsync(
    DapperMaticOperation context,
    string datasourceId,
    SchemaDto schema,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation context.
  • datasourceId (string) - The id of the datasource.
  • schema (SchemaDto) - The schema to create.
  • cancellationToken (CancellationToken) - Cancellation token.

Returns ​

Type: Task<SchemaDto>

The created schema.

DropSchemaAsync ​

Drops a schema from the specified datasource.

csharp
Task DropSchemaAsync(
    DapperMaticOperation context,
    string datasourceId,
    string schemaName,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation context.
  • datasourceId (string) - The id of the datasource.
  • schemaName (string) - The schema name.
  • cancellationToken (CancellationToken) - Cancellation token.

Returns ​

Type: Task

Task representing the asynchronous operation.

SchemaExistsAsync ​

Checks if a schema exists in the specified datasource.

csharp
Task&lt;bool&gt; SchemaExistsAsync(
    DapperMaticOperation context,
    string datasourceId,
    string schemaName,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation context.
  • datasourceId (string) - The id of the datasource.
  • schemaName (string) - The schema name.
  • cancellationToken (CancellationToken) - Cancellation token.

Returns ​

Type: Task&lt;bool&gt;

True if the schema exists, false otherwise.

GetViewsAsync ​

Gets all views from the specified datasource.

csharp
Task&lt;IEnumerable&lt;ViewDto&gt;&gt; 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.

csharp
Task&lt;ViewDto&gt; 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.

csharp
Task&lt;ViewDto&gt; 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.

csharp
Task&lt;ViewDto&gt; 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.

csharp
Task&lt;ViewDto&gt; 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.

csharp
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.

csharp
Task&lt;bool&gt; 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&lt;bool&gt;

True if the view exists, otherwise false.

QueryViewAsync ​

Queries a view with filtering, sorting, and pagination.

csharp
Task&lt;QueryResultDto&gt; 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.

GetDatasourceDataTypesAsync ​

Gets all available data types for a specific datasource.

csharp
Task&lt;(string, List&lt;DataTypeInfo&gt;)&gt; GetDatasourceDataTypesAsync(
    DapperMaticOperation context,
    string datasourceId,
    bool includeCustomTypes,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation context.
  • datasourceId (string) - The datasource identifier.
  • includeCustomTypes (bool) - If true, discovers custom types from the database in addition to static types.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<(string, List<DataTypeInfo>)>

A list of data types available in the datasource, including provider-specific types, extensions, and custom types.

GetTablesAsync ​

Gets all tables from the specified datasource.

csharp
Task&lt;IEnumerable&lt;TableDto&gt;&gt; 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.

csharp
Task&lt;TableDto&gt; 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.

csharp
Task&lt;TableDto&gt; 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.

DropTableAsync ​

Drops a table from the datasource.

csharp
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.

csharp
Task&lt;bool&gt; 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&lt;bool&gt;

True if the table exists, otherwise false.

InsertTableRowsAsync ​

Inserts rows into a table, all or none, each value converted to its column's type.

csharp
Task&lt;int&gt; InsertTableRowsAsync(
    DapperMaticOperation context,
    string datasourceId,
    string tableName,
    RowsInsertDto request,
    string schemaName,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation context.
  • datasourceId (string) - The datasource identifier.
  • tableName (string) - The table.
  • request (RowsInsertDto) - The rows.
  • schemaName (string) - Optional schema name.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task&lt;int&gt;

The number of rows inserted.

UpdateTableRowsAsync ​

Sets columns of the rows of a table that match a condition.

csharp
Task&lt;int&gt; UpdateTableRowsAsync(
    DapperMaticOperation context,
    string datasourceId,
    string tableName,
    RowsUpdateDto request,
    string schemaName,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation context.
  • datasourceId (string) - The datasource identifier.
  • tableName (string) - The table.
  • request (RowsUpdateDto) - The columns to set and the condition.
  • schemaName (string) - Optional schema name.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task&lt;int&gt;

The number of rows updated.

DeleteTableRowsAsync ​

Deletes the rows of a table that match a condition.

csharp
Task&lt;int&gt; DeleteTableRowsAsync(
    DapperMaticOperation context,
    string datasourceId,
    string tableName,
    RowsDeleteDto request,
    string schemaName,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation context.
  • datasourceId (string) - The datasource identifier.
  • tableName (string) - The table.
  • request (RowsDeleteDto) - The condition.
  • schemaName (string) - Optional schema name.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task&lt;int&gt;

The number of rows deleted.

SaveTableRowsAsync ​

Writes rows of a table with the rows they relate to, through declared relations, all or none: a related row whose key is given is updated if it exists and inserted if not; one without a key is inserted; and, with <paramref name="upsert" />, the rows themselves too. Every row is held to its table's policies.

csharp
Task&lt;RowsResponse&gt; SaveTableRowsAsync(
    DapperMaticOperation context,
    string datasourceId,
    string tableName,
    RowsInsertDto request,
    bool upsert,
    string schemaName,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation context.
  • datasourceId (string) - The datasource.
  • tableName (string) - The table.
  • request (RowsInsertDto) - The rows, related rows nested under their relations' names.
  • upsert (bool) - Whether the rows themselves are updated by their key when they exist, or inserted.
  • schemaName (string) - The schema, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<RowsResponse>

The number of rows written, and the rows as written.

BatchAsync ​

Runs writes of rows of a datasource's tables in order, in one transaction, all or none: each authorized and held to its table's policies as the row endpoints are, a later one able to use values an earlier one wrote.

csharp
Task&lt;BatchResponse&gt; BatchAsync(
    DapperMaticOperation context,
    string datasourceId,
    BatchDto request,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation context.
  • datasourceId (string) - The datasource.
  • request (BatchDto) - The operations.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<BatchResponse>

Each operation's result.

GetOpenApiDocumentAsync ​

Describes a datasource's rows as the caller may use them, in an OpenAPI 3.1 document: the tables and views it may read or write, only the actions its policies allow on each, and only the columns it may read or write.

csharp
Task&lt;JsonObject&gt; GetOpenApiDocumentAsync(
    DapperMaticOperation context,
    string datasourceId,
    string schemaName,
    string serverUrl,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation context, whose caller the document is for.
  • datasourceId (string) - The datasource.
  • schemaName (string) - The schema, or null for the default or the tenant's.
  • serverUrl (string) - The URL the document's paths are relative to.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task&lt;JsonObject&gt;

The document.

ExecuteFunctionAsync ​

Runs a function the application declares in Functions, as policies granting Execute allow: its arguments read from a JSON object by parameter name, those it takes from the request's context set whatever the request says.

csharp
Task&lt;FunctionResponse&gt; ExecuteFunctionAsync(
    DapperMaticOperation context,
    string datasourceId,
    string functionName,
    JsonElement} arguments,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation context.
  • datasourceId (string) - The datasource.
  • functionName (string) - The function.
  • arguments (JsonElement}) - The arguments, a JSON object; or null for none.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<FunctionResponse>

The rows it returned.

QueryTableAsync ​

Queries a table with filtering, sorting, and pagination.

csharp
Task&lt;QueryResultDto&gt; 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.

UpdateTableAsync ​

Updates an existing table in the datasource.

csharp
Task&lt;TableDto&gt; 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.

csharp
Task&lt;TableDto&gt; 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.

GetColumnsAsync ​

Gets all columns for a specific table.

csharp
Task&lt;IEnumerable&lt;ColumnDto&gt;&gt; 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>>

List of columns for the table.

GetColumnAsync ​

Gets a specific column from a table.

csharp
Task&lt;ColumnDto&gt; 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.

AddColumnAsync ​

Adds a new column to an existing table.

csharp
Task&lt;ColumnDto&gt; 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.

RenameColumnAsync ​

Updates an existing column in a table.

csharp
Task&lt;ColumnDto&gt; 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.

DropColumnAsync ​

Drops a column from a table.

csharp
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

Task representing the asynchronous operation.

GetIndexesAsync ​

Gets all indexes for a specific table.

csharp
Task&lt;IEnumerable&lt;IndexDto&gt;&gt; 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>>

List of indexes for the table.

GetIndexAsync ​

Gets a specific index from a table.

csharp
Task&lt;IndexDto&gt; 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.

CreateIndexAsync ​

Creates a new index on a table.

csharp
Task&lt;IndexDto&gt; 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 create index request.
  • schemaName (string) - Optional schema name.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<IndexDto>

The created index.

DropIndexAsync ​

Drops an index from a table.

csharp
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

Task representing the asynchronous operation.

GetPrimaryKeyConstraintAsync ​

Gets the primary key constraint for a table.

csharp
Task&lt;PrimaryKeyConstraintDto?&gt; 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 primary key constraint on a table.

csharp
Task&lt;PrimaryKeyConstraintDto&gt; CreatePrimaryKeyConstraintAsync(
    DapperMaticOperation context,
    string datasourceId,
    string tableName,
    PrimaryKeyConstraintDto primaryKeyConstraint,
    string schemaName,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation context.
  • datasourceId (string) - The datasource identifier.
  • tableName (string) - The table name.
  • primaryKeyConstraint (PrimaryKeyConstraintDto) - The create primary key request.
  • schemaName (string) - Optional schema name.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<PrimaryKeyConstraintDto>

The created primary key constraint.

DropPrimaryKeyConstraintAsync ​

Drops the primary key constraint from a table.

csharp
Task DropPrimaryKeyConstraintAsync(
    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

Task representing the asynchronous operation.

GetForeignKeyConstraintsAsync ​

Gets all foreign key constraints for a table.

csharp
Task&lt;IEnumerable&lt;ForeignKeyConstraintDto&gt;&gt; GetForeignKeyConstraintsAsync(
    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<ForeignKeyConstraintDto>>

List of foreign key constraints for the table.

GetForeignKeyConstraintAsync ​

Gets a specific foreign key constraint from a table.

csharp
Task&lt;ForeignKeyConstraintDto&gt; GetForeignKeyConstraintAsync(
    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<ForeignKeyConstraintDto>

The foreign key constraint if found.

CreateForeignKeyConstraintAsync ​

Creates a foreign key constraint on a table.

csharp
Task&lt;ForeignKeyConstraintDto&gt; CreateForeignKeyConstraintAsync(
    DapperMaticOperation context,
    string datasourceId,
    string tableName,
    ForeignKeyConstraintDto foreignKeyConstraint,
    string schemaName,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation context.
  • datasourceId (string) - The datasource identifier.
  • tableName (string) - The table name.
  • foreignKeyConstraint (ForeignKeyConstraintDto) - The create foreign key request.
  • schemaName (string) - Optional schema name.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<ForeignKeyConstraintDto>

The created foreign key constraint.

DropForeignKeyConstraintAsync ​

Drops a foreign key constraint from a table.

csharp
Task DropForeignKeyConstraintAsync(
    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.

GetCheckConstraintsAsync ​

Gets all check constraints for a table.

csharp
Task&lt;IEnumerable&lt;CheckConstraintDto&gt;&gt; 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.

csharp
Task&lt;CheckConstraintDto&gt; 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.

csharp
Task&lt;CheckConstraintDto&gt; 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.

csharp
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.

GetUniqueConstraintsAsync ​

Gets all unique constraints for a table.

csharp
Task&lt;IEnumerable&lt;UniqueConstraintDto&gt;&gt; GetUniqueConstraintsAsync(
    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<UniqueConstraintDto>>

List of unique constraints for the table.

GetUniqueConstraintAsync ​

Gets a specific unique constraint from a table.

csharp
Task&lt;UniqueConstraintDto&gt; GetUniqueConstraintAsync(
    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<UniqueConstraintDto>

The unique constraint if found.

CreateUniqueConstraintAsync ​

Creates a unique constraint on a table.

csharp
Task&lt;UniqueConstraintDto&gt; CreateUniqueConstraintAsync(
    DapperMaticOperation context,
    string datasourceId,
    string tableName,
    UniqueConstraintDto uniqueConstraint,
    string schemaName,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation context.
  • datasourceId (string) - The datasource identifier.
  • tableName (string) - The table name.
  • uniqueConstraint (UniqueConstraintDto) - The create unique constraint request.
  • schemaName (string) - Optional schema name.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<UniqueConstraintDto>

The created unique constraint.

DropUniqueConstraintAsync ​

Drops a unique constraint from a table.

csharp
Task DropUniqueConstraintAsync(
    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.

GetDefaultConstraintsAsync ​

Gets all default constraints for a table.

csharp
Task&lt;IEnumerable&lt;DefaultConstraintDto&gt;&gt; GetDefaultConstraintsAsync(
    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<DefaultConstraintDto>>

List of default constraints for the table.

GetDefaultConstraintAsync ​

Gets a specific default constraint from a table.

csharp
Task&lt;DefaultConstraintDto&gt; GetDefaultConstraintAsync(
    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<DefaultConstraintDto>

The default constraint if found, otherwise null.

GetDefaultConstraintOnColumnAsync ​

Gets a specific default constraint from a table for a column.

csharp
Task&lt;DefaultConstraintDto&gt; 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 default constraint on a table.

csharp
Task&lt;DefaultConstraintDto&gt; CreateDefaultConstraintAsync(
    DapperMaticOperation context,
    string datasourceId,
    string tableName,
    DefaultConstraintDto defaultConstraint,
    string schemaName,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation context.
  • datasourceId (string) - The datasource identifier.
  • tableName (string) - The table name.
  • defaultConstraint (DefaultConstraintDto) - The create default constraint request.
  • schemaName (string) - Optional schema name.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<DefaultConstraintDto>

The created default constraint if successful, otherwise null.

DropDefaultConstraintAsync ​

Drops a default constraint from a table.

csharp
Task DropDefaultConstraintAsync(
    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.

DropDefaultConstraintOnColumnAsync ​

Drops a column default constraint from a table.

csharp
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.