Class MsSqlDialect

Namespace: redb.MSSql.Sql
Assembly: redb.MSSql.dll

MS SQL Server implementation of ISqlDialect.
Uses SQL Server 2016+ features (JSON, STRING_SPLIT, sequences).
Parameters use , format (converted from $1, $2 in SqlRedbConnection).

public class MsSqlDialect : ISqlDialect

Inheritance

ObjectMsSqlDialect

Implements

Derived

Properties

ProviderName

Provider name (PostgreSQL, SqlServer, MySql)

public string ProviderName { get; }

Methods

FormatArrayContains(string, string)

MSSQL uses IN with STRING_SPLIT for array containment.

public string FormatArrayContains(string column, string paramName)

FormatPagination(int?, int?)

MSSQL pagination: OFFSET n ROWS FETCH NEXT m ROWS ONLY.

public string FormatPagination(int? limit, int? offset)

FormatParameter(int)

MSSQL parameter format (, , etc.).

public string FormatParameter(int index)

FormatPvtColumn(long, string, string)

PVT via subquery with TOP 1 (MSSQL doesn't have array_agg FILTER).

public string FormatPvtColumn(long structureId, string dbColumn, string alias)

GetDbTypeName(string)

Mapping of redb types to SQL types

public string GetDbTypeName(string redbType)

LazyLoader_GetObjectJson()

Get object as JSON via get_object_json. Params: $1=objectId, $2=maxDepth

public string LazyLoader_GetObjectJson()

LazyLoader_GetObjectJsonBatch()

Batch load Props JSON for multiple objects. Uses function call directly in SELECT.

public string LazyLoader_GetObjectJsonBatch()

LazyLoader_SelectObjectBase()

Get object base fields (without Props). Params: $1=objectId

public string LazyLoader_SelectObjectBase()

LazyLoader_SelectObjectHash()

Get object hash for cache validation. Params: $1=objectId

public string LazyLoader_SelectObjectHash()

ListItems_Delete()

DELETE list item by ID. Params: $1=itemId

public string ListItems_Delete()

ListItems_Insert()

INSERT list item. Params: $1=id, $2=idList, $3=value, $4=alias, $5=idObject

public string ListItems_Insert()

ListItems_SelectById()

SELECT list item by ID. Params: $1=itemId

public string ListItems_SelectById()

ListItems_SelectByListId()

SELECT list items by list ID. Params: $1=listId

public string ListItems_SelectByListId()

ListItems_SelectByListIdAndValue()

SELECT list item by list ID and value. Params: $1=listId, $2=value

public string ListItems_SelectByListIdAndValue()

ListItems_SelectByObjectId()

SELECT list items by object reference. Params: $1=objectId

public string ListItems_SelectByObjectId()

ListItems_Update()

UPDATE list item. Params: $1=value, $2=alias, $3=idObject, $4=id

public string ListItems_Update()

ListItems_UpdateAliasAndObject()

UPDATE list item alias and idObject. Params: $1=alias, $2=idObject, $3=id

public string ListItems_UpdateAliasAndObject()

Lists_Delete()

DELETE list by ID. Params: $1=listId

public string Lists_Delete()

Lists_Insert()

INSERT new list. Params: $1=id, $2=name, $3=alias

public string Lists_Insert()

Lists_IsUsedInStructures()

Check if list is used in structures. Params: $1=listId

public string Lists_IsUsedInStructures()

Lists_SelectAll()

SELECT all lists ordered by name.

public string Lists_SelectAll()

Lists_SelectById()

SELECT list by ID. Params: $1=listId

public string Lists_SelectById()

Lists_SelectByName()

SELECT list by name. Params: $1=name

public string Lists_SelectByName()

Lists_Update()

UPDATE list. Params: $1=name, $2=alias, $3=id

public string Lists_Update()

ObjectStorage_CheckObjectExists()

Check if object exists by ID. Params: $1=objectId

public string ObjectStorage_CheckObjectExists()

ObjectStorage_DeleteById()

DELETE object by ID. Params: $1=objectId

public string ObjectStorage_DeleteById()

ObjectStorage_DeleteByIds()

DELETE objects by IDs (bulk). Params: $1=objectIds (array)

public string ObjectStorage_DeleteByIds()

ObjectStorage_DeleteValuesByObjectId()

DELETE all values for object. Params: $1=objectId

public string ObjectStorage_DeleteValuesByObjectId()

ObjectStorage_GetObjectJson()

SELECT object as JSON. Params: $1=objectId, $2=depth

public string ObjectStorage_GetObjectJson()

ObjectStorage_GetObjectsJsonBulk()

Bulk get object JSON. Uses function call directly in SELECT.

public string ObjectStorage_GetObjectsJsonBulk()

ObjectStorage_InsertObject()

INSERT new object with all fields.

public string ObjectStorage_InsertObject()

ObjectStorage_LockObjectsForUpdate()

Lock objects for update (row locking). Params: $1=objectIds (array)

public string ObjectStorage_LockObjectsForUpdate()

ObjectStorage_SelectAllTypes()

SELECT all types (for cache preload). No params.

public string ObjectStorage_SelectAllTypes()

ObjectStorage_SelectExistingIds()

SELECT existing object IDs from array. Params: $1=objectIds (array)

public string ObjectStorage_SelectExistingIds()

ObjectStorage_SelectIdHash()

SELECT only Id and Hash for object. Params: $1=objectId

public string ObjectStorage_SelectIdHash()

ObjectStorage_SelectIdHashScheme()

SELECT Id, Hash, IdScheme for cache check. Params: $1=objectId

public string ObjectStorage_SelectIdHashScheme()

ObjectStorage_SelectObjectById()

SELECT all base fields for object by ID. Params: $1=objectId

public string ObjectStorage_SelectObjectById()

ObjectStorage_SelectObjectsByIds()

SELECT all base fields for objects by IDs. Params: $1=objectIds (array)

public string ObjectStorage_SelectObjectsByIds()

ObjectStorage_SelectSchemeById()

SELECT scheme by ID. Params: $1=schemeId

public string ObjectStorage_SelectSchemeById()

ObjectStorage_SelectSchemeIdByObjectId()

SELECT scheme ID for object. Params: $1=objectId

public string ObjectStorage_SelectSchemeIdByObjectId()

ObjectStorage_SelectSchemeIdsForObjects()

SELECT scheme IDs for objects. Params: $1=objectIds (array)

public string ObjectStorage_SelectSchemeIdsForObjects()

ObjectStorage_SelectSchemesByIds()

SELECT schemes by IDs. Params: $1=schemeIds (array)

public string ObjectStorage_SelectSchemesByIds()

ObjectStorage_SelectStructuresWithMetadata()

SELECT structure metadata by scheme ID. Params: $1=schemeId

public string ObjectStorage_SelectStructuresWithMetadata()

ObjectStorage_SelectStructureTypes()

SELECT structure types by IDs. Params: $1=structureIds (array)

public string ObjectStorage_SelectStructureTypes()

ObjectStorage_SelectTypeById()

SELECT type info by ID. Params: $1=typeId

public string ObjectStorage_SelectTypeById()

ObjectStorage_SelectValueById()

SELECT single value by ID. Params: $1=valueId

public string ObjectStorage_SelectValueById()

ObjectStorage_SelectValuesForObjects()

SELECT all values for object IDs (ChangeTracking). Params: $1=objectIds (array)

public string ObjectStorage_SelectValuesForObjects()

ObjectStorage_SelectValuesWithTypes()

SELECT existing values with types. Params: $1=objectId, $2=structureIds (array)

public string ObjectStorage_SelectValuesWithTypes()

ObjectStorage_UpdateObject()

UPDATE object with all fields.

public string ObjectStorage_UpdateObject()

Permissions_Count()

SELECT COUNT of all permissions

public string Permissions_Count()

Permissions_CountByRole()

SELECT COUNT of permissions by role. Params: $1=roleId

public string Permissions_CountByRole()

Permissions_CountByUser()

SELECT COUNT of permissions by user. Params: $1=userId

public string Permissions_CountByUser()

Permissions_Delete()

DELETE permission by ID. Params: $1=permissionId

public string Permissions_Delete()

Permissions_DeleteByRole()

DELETE permissions by role. Params: $1=roleId

public string Permissions_DeleteByRole()

Permissions_DeleteByUser()

DELETE all permissions by user. Params: $1=userId

public string Permissions_DeleteByUser()

Permissions_DeleteByUserRoleObject()

DELETE permission by user/role/object. Params: $1=userId, $2=roleId, $3=objectId

public string Permissions_DeleteByUserRoleObject()

Permissions_GetEffectiveForObject()

Uses MSSQL function get_user_permissions_for_object() from redb_permissions.sql.

public string Permissions_GetEffectiveForObject()

Permissions_Insert()

INSERT new permission. Params: $1=id, $2=userId, $3=roleId, $4=refId, $5=select, $6=insert, $7=update, $8=delete

public string Permissions_Insert()

Permissions_SelectById()

SELECT permission by ID. Params: $1=permissionId

public string Permissions_SelectById()

Permissions_SelectByObject()

SELECT permissions by object. Params: $1=objectId

public string Permissions_SelectByObject()

Permissions_SelectByRole()

SELECT permissions by role. Params: $1=roleId

public string Permissions_SelectByRole()

Permissions_SelectByUser()

SELECT permissions by user. Params: $1=userId

public string Permissions_SelectByUser()

Permissions_SelectByUserRoleObject()

MSSQL equivalent of IS NOT DISTINCT FROM.

public string Permissions_SelectByUserRoleObject()

Permissions_SelectReadableObjectIds()

SELECT readable object IDs for user. Params: $1=userId

public string Permissions_SelectReadableObjectIds()

Permissions_SelectUserRoleIds()

SELECT user's role IDs. Params: $1=userId

public string Permissions_SelectUserRoleIds()

Permissions_Update()

UPDATE permission flags. Params: $1=select, $2=insert, $3=update, $4=delete, $5=permissionId

public string Permissions_Update()

Query_AggregateArrayGroupedSql()

SQL for array grouped aggregation.

public string Query_AggregateArrayGroupedSql()

Query_AggregateBatchPreviewSql()

SQL for aggregate batch preview.

public string Query_AggregateBatchPreviewSql()

Query_AggregateBatchSql()

SQL for aggregate batch function.

public string Query_AggregateBatchSql()

Query_AggregateFieldSql()

SQL for aggregate field.

public string Query_AggregateFieldSql()

Query_AggregateGroupedSql()

SQL for grouped aggregation.

public string Query_AggregateGroupedSql()

Query_BigintArrayCast()

Bigint array cast. PostgreSQL: "::bigint[]"

public string Query_BigintArrayCast()

Query_CheckPermissionSql()

SQL for checking user permission on object.

public string Query_CheckPermissionSql()

Query_CountTemplate()

MSSQL uses EXEC and OPENJSON for JSON parameters.

public string Query_CountTemplate()

Query_GetIdsWithAncestorsSql(string)

MSSQL: Get all IDs with their ancestors using recursive CTE.

public string Query_GetIdsWithAncestorsSql(string idsString)

Query_GetParentIdsFromDescendantsSql(string, int)

MSSQL: WITH (without RECURSIVE) for traversing ancestors.

public string Query_GetParentIdsFromDescendantsSql(string idsString, int depthLimit)

Query_HasAncestorNormalSql(string)

HasAncestor with normal function (6 params) - MSSQL captures EXEC result in temp table.

public string Query_HasAncestorNormalSql(string functionName)

Query_HasAncestorTreeSql(string)

HasAncestor with tree function (8 params) - MSSQL captures EXEC result in temp table.

public string Query_HasAncestorTreeSql(string functionName)

Query_HasDescendantSql(string)

HasDescendant with normal function (6 params) - MSSQL captures EXEC result in temp table.

public string Query_HasDescendantSql(string functionName)

Query_JsonCast()

MSSQL doesn't need explicit JSON cast - it's handled by function signature.

public string Query_JsonCast()

Query_LoadObjectsByIdsSql(string, int)

MSSQL: Load objects by IDs as JSON using get_object_json function.

public string Query_LoadObjectsByIdsSql(string idsString, int maxDepth)

Query_ProjectionByIdsTemplate(string)

SQL for projection by structure IDs query.

public string Query_ProjectionByIdsTemplate(string structureIdsArray)

Query_ProjectionByPathsTemplate()

SQL for projection by paths query.

public string Query_ProjectionByPathsTemplate()

Query_SearchFullTemplate()

MSSQL always uses _base version, but C# passes 8 params when useLazyLoading=false.

public string Query_SearchFullTemplate()

Query_SearchObjectsBaseFunction()

Name of the search function for objects base fields only (lazy loading).

public string Query_SearchObjectsBaseFunction()

Query_SearchObjectsFunction()

Name of the search function for objects with facets (eager loading).

public string Query_SearchObjectsFunction()

Query_SearchObjectsProjectionByIdsFunction()

Name of the search function with projection by IDs.

public string Query_SearchObjectsProjectionByIdsFunction()

Query_SearchObjectsProjectionByPathsFunction()

Name of the search function with projection by paths.

public string Query_SearchObjectsProjectionByPathsFunction()

Query_SearchObjectsSimpleSql()

Simple search for Delete operations - uses search_objects_with_facets with minimal params.

public string Query_SearchObjectsSimpleSql()

Query_SearchTemplate()

MSSQL uses EXEC for stored procedures. Procedure returns 'result' column.

public string Query_SearchTemplate()

Query_SearchTreeObjectsBaseFunction()

Name of the tree search function base fields only (lazy loading).

public string Query_SearchTreeObjectsBaseFunction()

Query_SearchTreeObjectsFunction()

Name of the tree search function (eager loading).

public string Query_SearchTreeObjectsFunction()

Query_SearchWithDistinctTemplate()

SQL template for search query with distinct. Params: functionName

public string Query_SearchWithDistinctTemplate()

Query_SqlPreviewBaseFunction()

SQL preview function name for base (lazy loading) search.

public string Query_SqlPreviewBaseFunction()

Query_SqlPreviewFunction()

SQL preview function name for regular search.

public string Query_SqlPreviewFunction()

Query_SqlPreviewTemplate()

SQL for SQL preview function.

public string Query_SqlPreviewTemplate()

Query_TextArrayCast()

MSSQL uses STRING_SPLIT instead of array cast.

public string Query_TextArrayCast()

Query_TreeCountNormalSql(string)

For Tree procedures, we use temp table to capture EXEC result and extract total_count.

public string Query_TreeCountNormalSql(string functionName)

Query_TreeCountWithParentIdsSql(string)

MSSQL: capture EXEC result and extract total_count.

public string Query_TreeCountWithParentIdsSql(string functionName)

Query_TreeSearchNormalSql(string)

SQL for tree search query (normal search).

public string Query_TreeSearchNormalSql(string functionName)

Query_TreeSearchWithParentIdsSql(string)

Tree search with parent_ids array (8 params).

public string Query_TreeSearchWithParentIdsSql(string functionName)

Query_TreeSqlPreviewBaseFunction()

SQL preview function name for tree base (lazy loading) search.

public string Query_TreeSqlPreviewBaseFunction()

Query_TreeSqlPreviewFunction()

SQL preview function name for tree search.

public string Query_TreeSqlPreviewFunction()

Query_TreeSqlPreviewTemplate(string)

SQL for tree SQL preview.

public string Query_TreeSqlPreviewTemplate(string functionName)

Query_WindowSql()

SQL for window query.

public string Query_WindowSql()

QuoteIdentifier(string)

Identifier escaping: "name" for PostgreSQL, [name] for MSSQL

public string QuoteIdentifier(string name)

Roles_Count()

SELECT COUNT of all roles

public string Roles_Count()

Roles_Delete()

DELETE role by ID. Params: $1=roleId

public string Roles_Delete()

Roles_ExistsById()

Check role exists by ID. Params: $1=roleId

public string Roles_ExistsById()

Roles_ExistsByName()

Check if role name exists (excluding role). Params: $1=name, $2=excludeId (optional)

public string Roles_ExistsByName()

Roles_ExistsByNameExcluding()

Check if role name exists excluding specific role. Params: $1=name, $2=excludeId

public string Roles_ExistsByNameExcluding()

Roles_Insert()

INSERT new role. Params: $1=id, $2=name

public string Roles_Insert()

Roles_SelectAll()

SELECT all roles ordered by name. Returns: Id, Name, IdConfiguration

public string Roles_SelectAll()

Roles_SelectById()

SELECT role by ID. Returns: Id, Name, IdConfiguration

public string Roles_SelectById()

Roles_SelectByName()

SELECT role by name. Returns: Id, Name, IdConfiguration

public string Roles_SelectByName()

Roles_SelectConfigurationId()

SELECT role configuration ID. Params: $1=roleId

public string Roles_SelectConfigurationId()

Roles_SelectIdByName()

SELECT role by name. Params: $1=roleName

public string Roles_SelectIdByName()

Roles_UpdateConfiguration()

UPDATE role configuration. Params: $1=configId, $2=roleId

public string Roles_UpdateConfiguration()

Roles_UpdateName()

UPDATE role name. Params: $1=newName, $2=roleId

public string Roles_UpdateName()

Schemes_ExistsByName()

Check scheme exists by name. Params: $1=name

public string Schemes_ExistsByName()

Schemes_GetStructureTree()

Get structure tree JSON. Params: $1=schemeId

public string Schemes_GetStructureTree()

Schemes_Insert()

INSERT new scheme. Params: $1=id, $2=name, $3=alias, $4=type

public string Schemes_Insert()

Schemes_InsertObject()

INSERT Object scheme. Params: $1=id, $2=name, $3=type

public string Schemes_InsertObject()

Schemes_MigrateStructureType()

Migrate structure type. Params: $1=structureId, $2=oldType, $3=newType, $4=dryRun

public string Schemes_MigrateStructureType()

Schemes_SelectAll()

SELECT all schemes.

public string Schemes_SelectAll()

Schemes_SelectById()

SELECT scheme by ID. Params: $1=schemeId

public string Schemes_SelectById()

Schemes_SelectByName()

SELECT scheme by name. Params: $1=name

public string Schemes_SelectByName()

Schemes_SelectHashById()

SELECT scheme hash by ID. Params: $1=schemeId

public string Schemes_SelectHashById()

Schemes_SelectObjectByName()

SELECT Object scheme by name and type. Params: $1=name, $2=type

public string Schemes_SelectObjectByName()

Schemes_SyncMetadataCache()

Sync metadata cache for scheme. Uses MSSQL stored procedure.

public string Schemes_SyncMetadataCache()

Schemes_UpdateHash()

UPDATE scheme structure hash. Params: $1=hash, $2=schemeId

public string Schemes_UpdateHash()

Schemes_UpdateName()

Update scheme name by ID.

public string Schemes_UpdateName()

SoftDelete_ClaimOrphanedTask()

Atomically claim an orphaned task for processing.

public string SoftDelete_ClaimOrphanedTask()

SoftDelete_GetDeletionProgress()

Gets deletion progress for a specific trash container.

public string SoftDelete_GetDeletionProgress()

SoftDelete_GetOrphanedTasks()

Gets orphaned deletion tasks for recovery at startup.

public string SoftDelete_GetOrphanedTasks()

SoftDelete_GetUserActiveDeletions()

Gets all active deletions for a user.

public string SoftDelete_GetUserActiveDeletions()

SoftDelete_MarkForDeletion()

Calls sp_mark_for_deletion procedure to soft-delete objects.

public string SoftDelete_MarkForDeletion()

SoftDelete_PurgeTrash()

Calls sp_purge_trash procedure to physically delete objects from trash.

public string SoftDelete_PurgeTrash()

Structures_DeleteByIds(IEnumerable<long>)

DELETE structures by IDs. Params: dynamic IN clause

public string Structures_DeleteByIds(IEnumerable<long> ids)

Structures_Insert()

INSERT new structure.

public string Structures_Insert()

Structures_SelectByScheme()

SELECT full structures by scheme. Params: $1=schemeId

public string Structures_SelectByScheme()

Structures_SelectBySchemeCacheable()

SELECT structures with cache fields by scheme. Params: $1=schemeId

public string Structures_SelectBySchemeCacheable()

Structures_SelectBySchemeShort()

SELECT structures short fields by scheme. Params: $1=schemeId

public string Structures_SelectBySchemeShort()

Structures_UpdateAlias()

UPDATE structure alias. Params: $1=alias, $2=structureId

public string Structures_UpdateAlias()

Structures_UpdateAllowNotNull()

UPDATE structure allow_not_null. Params: $1=allowNotNull, $2=structureId

public string Structures_UpdateAllowNotNull()

Structures_UpdateCollectionType()

UPDATE structure collection type. Params: $1=collectionType, $2=structureId

public string Structures_UpdateCollectionType()

Structures_UpdateKeyType()

UPDATE structure key type. Params: $1=keyType, $2=structureId

public string Structures_UpdateKeyType()

Structures_UpdateType()

UPDATE structure type. Params: $1=typeId, $2=structureId

public string Structures_UpdateType()

Tree_DeleteObjectsByIds()

DELETE objects by IDs. Params: $1=objectIds (array)

public string Tree_DeleteObjectsByIds()

Tree_DeleteValuesByObjectIds()

DELETE values by object IDs. Params: $1=objectIds (array)

public string Tree_DeleteValuesByObjectIds()

Tree_GetObjectJson()

Get object as JSON. Params: $1=objectId, $2=depth

public string Tree_GetObjectJson()

Tree_ObjectExists()

Check if object exists. Params: $1=objectId

public string Tree_ObjectExists()

Tree_SelectChildrenBase()

SELECT all children base fields by parent (Pro PVT polymorphic mode).

public string Tree_SelectChildrenBase()

Tree_SelectChildrenBySchemeBase()

SELECT children base fields by parent and scheme (Pro PVT mode).

public string Tree_SelectChildrenBySchemeBase()

Tree_SelectChildrenJson()

SELECT children with JSON by parent and scheme. Params: $1=parentId, $2=schemeId

public string Tree_SelectChildrenJson()

Tree_SelectParentId()

SELECT parent_id by object ID. Params: $1=objectId

public string Tree_SelectParentId()

Tree_SelectPolymorphicChildren()

SELECT polymorphic children with scheme. Params: $1=parentId

public string Tree_SelectPolymorphicChildren()

Tree_SelectSchemeAndJson()

SELECT scheme and JSON for object. Params: $1=objectId

public string Tree_SelectSchemeAndJson()

Tree_UpdateParent()

UPDATE object parent (move). Params: $1=newParentId, $2=dateModify, $3=whoChangeId, $4=objectId

public string Tree_UpdateParent()

Types_SelectAll()

SELECT all types. Returns: _id, _name, _db_type, _type

public string Types_SelectAll()

Types_SelectByName()

SELECT type by name. Params: $1=name

public string Types_SelectByName()

Users_Count()

SELECT COUNT of all users

public string Users_Count()

Users_CountEnabled()

SELECT COUNT of enabled users

public string Users_CountEnabled()

Users_ExistsByEmail()

Check email exists. Params: $1=email

public string Users_ExistsByEmail()

Users_ExistsById()

Check if user exists by ID. Params: $1=userId

public string Users_ExistsById()

Users_ExistsByLogin()

Check login exists. Params: $1=login

public string Users_ExistsByLogin()

Users_ExistsByLoginExcluding()

Check login exists excluding user. Params: $1=login, $2=excludeUserId

public string Users_ExistsByLoginExcluding()

Users_Insert()

INSERT new user with all fields.

public string Users_Insert()

Users_SelectById()

SELECT all user fields by ID. Params: $1=userId

public string Users_SelectById()

Users_SelectByLogin()

SELECT all user fields by login. Params: $1=login

public string Users_SelectByLogin()

Users_SelectConfigurationId()

SELECT user configuration ID. Params: $1=userId

public string Users_SelectConfigurationId()

Users_SelectIdByLogin()

SELECT user by login. Params: $1=login. Returns: Id

public string Users_SelectIdByLogin()

Users_SoftDelete()

UPDATE user for soft delete. Params: $1=newLogin, $2=newName, $3=enabled, $4=dateDismiss, $5=userId

public string Users_SoftDelete()

Users_Update()

UPDATE user fields.

public string Users_Update()

Users_UpdateConfiguration()

UPDATE user configuration. Params: $1=configId, $2=userId

public string Users_UpdateConfiguration()

Users_UpdatePassword()

UPDATE user password. Params: $1=hashedPassword, $2=userId

public string Users_UpdatePassword()

Users_UpdateStatus()

UPDATE user enabled status. Params: $1=enabled, $2=dateDismiss, $3=userId

public string Users_UpdateStatus()

UsersRoles_CountByRole()

SELECT COUNT of users for role. Params: $1=roleId

public string UsersRoles_CountByRole()

UsersRoles_Delete()

DELETE user-role assignment. Params: $1=userId, $2=roleId

public string UsersRoles_Delete()

UsersRoles_DeleteByRole()

DELETE all user-role assignments for role. Params: $1=roleId

public string UsersRoles_DeleteByRole()

UsersRoles_DeleteByUser()

DELETE all user-role assignments for user. Params: $1=userId

public string UsersRoles_DeleteByUser()

UsersRoles_Exists()

Check if user-role assignment exists. Params: $1=userId, $2=roleId

public string UsersRoles_Exists()

UsersRoles_Insert()

INSERT user-role assignment. Params: $1=id, $2=userId, $3=roleId

public string UsersRoles_Insert()

UsersRoles_SelectRolesByUser()

SELECT roles for user. Params: $1=userId. Returns: Id, Name, IdConfiguration

public string UsersRoles_SelectRolesByUser()

UsersRoles_SelectUsersByRole()

SELECT users for role. Params: $1=roleId. Returns user fields

public string UsersRoles_SelectUsersByRole()

Validation_SelectAllTypes()

SELECT all types for validation.

public string Validation_SelectAllTypes()

Validation_SelectSchemeByName()

SELECT scheme by name. Params: $1=schemeName

public string Validation_SelectSchemeByName()

Validation_SelectStructuresBySchemeId()

SELECT structures by scheme ID. Params: $1=schemeId

public string Validation_SelectStructuresBySchemeId()

Warmup_AllMetadataCaches()

MSSQL uses stored procedure, returns same columns as PostgreSQL function.

public string Warmup_AllMetadataCaches()

WrapSubquery(string, string)

Subquery wrapper: (subquery) AS alias

public string WrapSubquery(string subquery, string alias)