@memberjunction/generic-database-provider 0.0.1 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,45 +1,134 @@
1
1
  # @memberjunction/generic-database-provider
2
2
 
3
- ## ⚠️ IMPORTANT NOTICE ⚠️
4
-
5
- **This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
6
-
7
- This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
8
-
9
- ## Purpose
10
-
11
- This package exists to:
12
- 1. Configure OIDC trusted publishing for the package name `@memberjunction/generic-database-provider`
13
- 2. Enable secure, token-less publishing from CI/CD workflows
14
- 3. Establish provenance for packages published under this name
15
-
16
- ## What is OIDC Trusted Publishing?
17
-
18
- OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
19
-
20
- ## Setup Instructions
21
-
22
- To properly configure OIDC trusted publishing for this package:
23
-
24
- 1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
25
- 2. Configure the trusted publisher (e.g., GitHub Actions)
26
- 3. Specify the repository and workflow that should be allowed to publish
27
- 4. Use the configured workflow to publish your actual package
28
-
29
- ## DO NOT USE THIS PACKAGE
30
-
31
- This package is a placeholder for OIDC configuration only. It:
32
- - Contains no executable code
33
- - Provides no functionality
34
- - Should not be installed as a dependency
35
- - Exists only for administrative purposes
36
-
37
- ## More Information
38
-
39
- For more details about npm's trusted publishing feature, see:
40
- - [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
41
- - [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
42
-
43
- ---
44
-
45
- **Maintained for OIDC setup purposes only**
3
+ Intermediate abstract base class for MemberJunction database providers. Sits between the lightweight `DatabaseProviderBase` (in `@memberjunction/core`) and platform-specific providers (`SQLServerDataProvider`, `PostgreSQLDataProvider`).
4
+
5
+ ## Why This Package Exists
6
+
7
+ `DatabaseProviderBase` in MJCore cannot depend on heavy packages like `@memberjunction/actions`, `@memberjunction/aiengine`, `@memberjunction/encryption`, or `@memberjunction/core-entities`. However, the entity action hooks, AI action processing, field-level encryption, and view WHERE clause rendering logic is shared between SQL Server and PostgreSQL providers.
8
+
9
+ This package provides a single implementation of that shared logic, eliminating code duplication while keeping MJCore lightweight.
10
+
11
+ ## Inheritance Chain
12
+
13
+ ```
14
+ DatabaseProviderBase (@memberjunction/core — no heavy deps, abstract)
15
+ └── GenericDatabaseProvider (this package — ActionEngine, AIEngine, EncryptionEngine)
16
+ ├── SQLServerDataProvider (@memberjunction/sqlserver-dataprovider)
17
+ └── PostgreSQLDataProvider (@memberjunction/postgresql-dataprovider)
18
+ ```
19
+
20
+ ## What It Provides
21
+
22
+ | Method | Description |
23
+ |--------|-------------|
24
+ | `HandleEntityActions()` | Discovers and runs active entity actions for save/delete/validate via `EntityActionEngineServer` |
25
+ | `HandleEntityAIActions()` | Runs AI-triggered entity actions (before save blocks, after save fires and forgets) |
26
+ | `GetEntityAIActions()` | Filters `AIEngine.EntityAIActions` for the given entity and timing |
27
+ | `EnqueueAfterSaveAIAction()` | Virtual hook for after-save AI task enqueueing (overridden by SQL Server for transaction deferral) |
28
+ | `OnValidateBeforeSave()` | Runs validation entity actions and returns error messages |
29
+ | `OnBeforeSaveExecute()` | Runs before-save entity actions and AI actions |
30
+ | `OnAfterSaveExecute()` | Fires after-save entity/AI actions (no await) |
31
+ | `OnBeforeDeleteExecute()` | Runs before-delete entity actions and AI actions |
32
+ | `OnAfterDeleteExecute()` | Fires after-delete entity/AI actions (no await) |
33
+ | `PostProcessRows()` | Platform-specific datetime adjustment (via `AdjustDatetimeFields` hook) + field-level decryption using `EncryptionEngine` |
34
+ | `AdjustDatetimeFields()` | Virtual hook for platform-specific datetime corrections (no-op default; SQL Server overrides for DATETIMEOFFSET) |
35
+ | `ExecuteSQLBatch()` | Executes multiple SQL queries; default runs in parallel via `Promise.all(ExecuteSQL(...))`, SQL Server overrides for true multi-result-set batching |
36
+ | `GetDatasetStatusByName()` | Retrieves dataset item status (max date + row count) using `ExecuteSQLBatch` |
37
+ | `CreateSqlLogger()` | Creates a SQL logging session that captures all SQL operations to a file |
38
+ | `GetActiveSqlLoggingSessions()` | Lists all active SQL logging sessions |
39
+ | `GetSqlLoggingSessionById()` | Retrieves a specific logging session by ID |
40
+ | `DisposeAllSqlLoggingSessions()` | Disposes all active logging sessions (used on shutdown) |
41
+ | `LogSQLStatement()` | Static method to log SQL from external sources (e.g., transaction groups) |
42
+ | `RenderViewWhereClause()` | Resolves `{%UserView "id"%}` templates in saved view WHERE clauses |
43
+ | `InternalRunView()` | Shared view execution engine: view resolution, permissions, field selection, WHERE clause, ORDER BY, pagination, aggregates, audit logging |
44
+ | `InternalRunViews()` | Parallel wrapper for multiple InternalRunView calls |
45
+ | `getRunTimeViewFieldString()` | Builds dialect-neutral field list string for view queries |
46
+ | `getRunTimeViewFieldArray()` | Resolves EntityFieldInfo list from params/view/entity |
47
+ | `createViewUserSearchSQL()` | Builds full-text search and LIKE-based user search SQL |
48
+ | `BuildPaginationSQL()` | Abstract: platform-specific OFFSET/FETCH or LIMIT/OFFSET |
49
+ | `BuildTopClause()` | Virtual: SQL Server TOP N, PG returns empty (default) |
50
+ | `BuildNonPaginatedLimitSQL()` | Virtual: PG LIMIT N for non-paginated row limits (default: empty) |
51
+ | `TransformExternalSQLClause()` | Virtual: PG overrides to quote mixed-case identifiers (default: no-op) |
52
+ | `executeSQLForUserViewRunLogging()` | Virtual: SQL Server overrides for view run audit logging (default: null) |
53
+ | `Load()` | Loads a single entity record by composite key with dialect-neutral quoting, char field trimming, relationship loading, and PostProcessRows |
54
+ | `GetDatasetByName()` | Retrieves a dataset by name, executes item queries with dialect-neutral SQL, applies PostProcessRows |
55
+ | `RunViewsWithCacheCheck()` | Smart cache validation for batch RunViews: compares MAX(__mj_UpdatedAt)/COUNT(*), supports differential updates |
56
+ | `RunQueriesWithCacheCheck()` | Smart cache validation for batch RunQueries using CacheValidationSQL |
57
+ | `isCacheCurrent()` | Compares client cache status with server status (date + row count) |
58
+ | `buildWhereClauseForCacheCheck()` | Virtual: builds WHERE from ExtraFilter, UserSearch, and RLS |
59
+ | `getBatchedServerCacheStatus()` | Virtual: batched server-side cache status check (default: parallel individual queries; SQL Server overrides for ExecuteSQLBatch) |
60
+ | `getBatchedQueryCacheStatus()` | Virtual: batched query cache status check (default: parallel individual queries; SQL Server overrides for ExecuteSQLBatch) |
61
+ | `runFullQueryAndReturn()` | Wraps InternalRunView with maxUpdatedAt extraction |
62
+ | `runDifferentialQueryAndReturn()` | Returns only changed rows since client's cached state, with hidden-delete detection |
63
+ | `getDeletedRecordIDsSince()` | Virtual: queries RecordChange table for deletions since a timestamp |
64
+ | `getUpdatedRowsSince()` | Virtual: queries entity view for rows updated since a timestamp |
65
+ | `resolveQueryInfo()` | Resolves QueryInfo from RunQueryParams (by ID or Name+CategoryPath) |
66
+ | `findQueryInEngine()` | Searches QueryEngine for a fresh query entity |
67
+ | `refreshQueryInfoFromEntity()` | Creates fresh QueryInfo from entity and patches ProviderBase cache |
68
+ | `resolveCategoryPath()` | Resolves hierarchical category path to CategoryID |
69
+ | `BuildParameterPlaceholder()` | Virtual: PG-style $1/$2 by default; SQL Server overrides to @p0/@p1 |
70
+ | `getColumnsForDatasetItem()` | Validates and quotes column names for dataset item queries |
71
+
72
+ ## Usage
73
+
74
+ Platform-specific providers should extend `GenericDatabaseProvider` instead of `DatabaseProviderBase`:
75
+
76
+ ```typescript
77
+ import { GenericDatabaseProvider } from '@memberjunction/generic-database-provider';
78
+
79
+ export class MyDatabaseProvider extends GenericDatabaseProvider {
80
+ // Implement remaining abstract methods from DatabaseProviderBase
81
+ // Override EnqueueAfterSaveAIAction if you need transaction-aware deferral
82
+ // Override PostProcessRows if you need platform-specific row processing (call super first)
83
+ }
84
+ ```
85
+
86
+ ## SQL Logging
87
+
88
+ The SQL logging subsystem lives in GenericDatabaseProvider so it is available to all platform-specific providers (SQL Server, PostgreSQL, etc.). Sessions capture executed SQL statements to files with filtering, formatting, and Flyway migration support.
89
+
90
+ ```typescript
91
+ import { Metadata } from '@memberjunction/core';
92
+ import type { GenericDatabaseProvider } from '@memberjunction/generic-database-provider';
93
+
94
+ const provider = Metadata.Provider as GenericDatabaseProvider;
95
+
96
+ // Create a logging session
97
+ const session = await provider.CreateSqlLogger('./logs/operations.sql', {
98
+ statementTypes: 'mutations',
99
+ prettyPrint: true,
100
+ filterPatterns: [/spCreateAIPromptRun/i],
101
+ filterType: 'exclude',
102
+ });
103
+
104
+ try {
105
+ // All SQL operations are automatically captured
106
+ await provider.ExecuteSQL('INSERT INTO ...');
107
+ } finally {
108
+ await session.dispose();
109
+ }
110
+ ```
111
+
112
+ Key types exported from this package:
113
+
114
+ | Export | Type | Description |
115
+ |--------|------|-------------|
116
+ | `SqlLoggingOptions` | Interface | Configuration options for SQL logging sessions |
117
+ | `SqlLoggingSession` | Interface | Public interface for an active logging session |
118
+ | `SqlLoggingSessionImpl` | Class | Internal session implementation (file I/O, formatting, filtering) |
119
+
120
+ ## Switching Database Platforms (Developer Note)
121
+
122
+ When developing against both SQL Server and PostgreSQL on the same URL/port, **clear your browser cache** after switching backends. The client-side `GraphQLDataProvider` caches entity metadata and query results in the browser. UUID casing differs between platforms (SQL Server: uppercase, PostgreSQL: lowercase), so stale cached data from one platform will cause subtle mismatches on the other. Clear browser cache or use an incognito window whenever you switch the backend database.
123
+
124
+ ## Dependencies
125
+
126
+ - `@memberjunction/core` — Base class and entity types
127
+ - `@memberjunction/core-entities` — `MJUserViewEntityExtended`, `ViewInfo` for view WHERE clause rendering
128
+ - `@memberjunction/actions` / `@memberjunction/actions-base` — Entity action engine
129
+ - `@memberjunction/aiengine` — AI action execution
130
+ - `@memberjunction/encryption` — Field-level encryption/decryption
131
+ - `@memberjunction/global` — Global object store, `ensureRegExps` for pattern filtering
132
+ - `@memberjunction/queue` — Task queue for after-save AI actions
133
+ - `sql-formatter` — SQL pretty-printing for log output
134
+ - `uuid` — Session ID generation
@@ -0,0 +1,426 @@
1
+ /**
2
+ * @fileoverview Generic Database Provider for MemberJunction
3
+ *
4
+ * This module provides an intermediate abstract base class between DatabaseProviderBase (MJCore)
5
+ * and platform-specific providers (SQLServerDataProvider, PostgreSQLDataProvider).
6
+ *
7
+ * It contains shared logic that requires heavy dependencies (ActionEngine, AIEngine,
8
+ * EncryptionEngine, MJCoreEntities) which cannot live in MJCore's lightweight base class.
9
+ *
10
+ * Inheritance chain:
11
+ * DatabaseProviderBase (MJCore — no heavy deps)
12
+ * └── GenericDatabaseProvider (this package — has ActionEngine, AIEngine, EncryptionEngine)
13
+ * ├── SQLServerDataProvider (adds datetime handling, SQL logging, mssql-specific)
14
+ * └── PostgreSQLDataProvider (adds pg-specific connection management)
15
+ *
16
+ * @module @memberjunction/generic-database-provider
17
+ */
18
+ import { BaseEntity, DatabaseProviderBase, EntityInfo, EntityFieldInfo, EntitySaveOptions, EntityDeleteOptions, RunViewParams, RunViewResult, RunViewWithCacheCheckParams, RunViewsWithCacheCheckResponse, RunViewWithCacheCheckResult, RunQueryParams, RunQueryWithCacheCheckParams, RunQueriesWithCacheCheckResponse, RunQueryWithCacheCheckResult, QueryInfo, CompositeKey, DatasetItemFilterType, DatasetResultType, DatasetStatusResultType, IMetadataProvider, UserInfo } from '@memberjunction/core';
19
+ import { SqlLoggingOptions, SqlLoggingSession } from './types.js';
20
+ import { MJEntityAIActionEntity, MJQueryEntity, MJUserViewEntityExtended } from '@memberjunction/core-entities';
21
+ import { EntityAIActionParams } from '@memberjunction/aiengine';
22
+ import { ActionResult } from '@memberjunction/actions-base';
23
+ /**
24
+ * Configuration options for batch SQL execution.
25
+ * Shared between GenericDatabaseProvider and platform-specific providers.
26
+ */
27
+ export interface ExecuteSQLBatchOptions {
28
+ /** Optional description for this batch operation */
29
+ description?: string;
30
+ /** If true, this batch will not be logged to any logging session */
31
+ ignoreLogging?: boolean;
32
+ /** Whether this batch contains data mutation operations */
33
+ isMutation?: boolean;
34
+ }
35
+ /**
36
+ * GenericDatabaseProvider is an intermediate abstract class that implements shared
37
+ * entity action, AI action, encryption, and view WHERE clause rendering logic.
38
+ *
39
+ * Platform-specific providers should extend this class instead of DatabaseProviderBase
40
+ * to inherit these shared behaviors.
41
+ */
42
+ export declare abstract class GenericDatabaseProvider extends DatabaseProviderBase {
43
+ /**************************************************************************/
44
+ /**************************************************************************/
45
+ private static _sqlLoggingSessionsKey;
46
+ private get _sqlLoggingSessions();
47
+ /**
48
+ * Creates a new SQL logging session that will capture all SQL operations to a file.
49
+ * Returns a disposable session object that must be disposed to stop logging.
50
+ *
51
+ * @param filePath - Full path to the file where SQL statements will be logged
52
+ * @param options - Optional configuration for the logging session
53
+ * @returns Promise<SqlLoggingSession> - Disposable session object
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * // Basic usage
58
+ * const session = await provider.CreateSqlLogger('./logs/metadata-sync.sql');
59
+ * try {
60
+ * // Perform operations that will be logged
61
+ * await provider.ExecuteSQL('INSERT INTO ...');
62
+ * } finally {
63
+ * await session.dispose(); // Stop logging
64
+ * }
65
+ *
66
+ * // With migration formatting
67
+ * const session = await provider.CreateSqlLogger('./migrations/changes.sql', {
68
+ * formatAsMigration: true,
69
+ * description: 'MetadataSync push operation'
70
+ * });
71
+ * ```
72
+ */
73
+ CreateSqlLogger(filePath: string, options?: SqlLoggingOptions): Promise<SqlLoggingSession>;
74
+ /**
75
+ * Gets information about all active SQL logging sessions.
76
+ * Useful for monitoring and debugging.
77
+ *
78
+ * @returns Array of session information objects
79
+ */
80
+ GetActiveSqlLoggingSessions(): Array<{
81
+ id: string;
82
+ filePath: string;
83
+ startTime: Date;
84
+ statementCount: number;
85
+ options: SqlLoggingOptions;
86
+ }>;
87
+ /**
88
+ * Gets a specific SQL logging session by its ID.
89
+ * Returns the session if found, or undefined if not found.
90
+ *
91
+ * @param sessionId - The unique identifier of the session to retrieve
92
+ * @returns The SqlLoggingSession if found, undefined otherwise
93
+ */
94
+ GetSqlLoggingSessionById(sessionId: string): SqlLoggingSession | undefined;
95
+ /**
96
+ * Disposes all active SQL logging sessions.
97
+ * Useful for cleanup on provider shutdown.
98
+ */
99
+ DisposeAllSqlLoggingSessions(): Promise<void>;
100
+ /**
101
+ * Internal method to log SQL statement to all active logging sessions.
102
+ * This is called automatically by ExecuteSQL methods.
103
+ * Protected so platform-specific providers can reference it (e.g., to bind as a callback).
104
+ *
105
+ * @param query - The SQL query being executed
106
+ * @param parameters - Parameters for the query
107
+ * @param description - Optional description for this operation
108
+ * @param ignoreLogging - If true, this statement will not be logged
109
+ * @param isMutation - Whether this is a data mutation operation
110
+ * @param simpleSQLFallback - Optional simple SQL to use for loggers with logRecordChangeMetadata=false
111
+ * @param contextUser - Optional user context for session filtering
112
+ */
113
+ protected _logSqlStatement(query: string, parameters?: unknown, description?: string, ignoreLogging?: boolean, isMutation?: boolean, simpleSQLFallback?: string, contextUser?: UserInfo): Promise<void>;
114
+ /**
115
+ * Static method to log SQL statements from external sources like transaction groups.
116
+ * Gets the current provider instance from Metadata.Provider and delegates to the
117
+ * instance _logSqlStatement method.
118
+ *
119
+ * @param query - The SQL query being executed
120
+ * @param parameters - Parameters for the query
121
+ * @param description - Optional description for this operation
122
+ * @param isMutation - Whether this is a data mutation operation
123
+ * @param simpleSQLFallback - Optional simple SQL to use for loggers with logRecordChangeMetadata=false
124
+ * @param contextUser - Optional user context for session filtering
125
+ */
126
+ static LogSQLStatement(query: string, parameters?: unknown, description?: string, isMutation?: boolean, simpleSQLFallback?: string, contextUser?: UserInfo): Promise<void>;
127
+ /**************************************************************************/
128
+ /**************************************************************************/
129
+ /**
130
+ * Returns AI actions configured for the given entity and timing.
131
+ * Uses AIEngine metadata to find matching EntityAIAction records.
132
+ */
133
+ protected GetEntityAIActions(entityInfo: EntityInfo, before: boolean): MJEntityAIActionEntity[];
134
+ /**
135
+ * Handles entity actions (non-AI) for save, delete, or validate operations.
136
+ * Uses EntityActionEngineServer to discover and run active actions.
137
+ */
138
+ protected HandleEntityActions(entity: BaseEntity, baseType: 'save' | 'delete' | 'validate', before: boolean, user: UserInfo): Promise<ActionResult[]>;
139
+ /**
140
+ * Handles Entity AI Actions for save or delete operations.
141
+ *
142
+ * For "before save" actions: blocks (awaits) until complete.
143
+ * For "after save" actions: fires and forgets via QueueManager.
144
+ *
145
+ * Subclasses that manage transactions can override to defer after-save tasks
146
+ * until after transaction commit (see SQLServerDataProvider).
147
+ */
148
+ protected HandleEntityAIActions(entity: BaseEntity, baseType: 'save' | 'delete', before: boolean, user: UserInfo): Promise<void>;
149
+ /**
150
+ * Enqueues an after-save AI action for execution. By default, immediately adds
151
+ * to QueueManager. Subclasses with transaction support can override to defer
152
+ * until after transaction commit.
153
+ */
154
+ protected EnqueueAfterSaveAIAction(params: EntityAIActionParams, user: UserInfo): void;
155
+ /**************************************************************************/
156
+ /**************************************************************************/
157
+ protected OnValidateBeforeSave(entity: BaseEntity, user: UserInfo): Promise<string | null>;
158
+ protected OnBeforeSaveExecute(entity: BaseEntity, user: UserInfo, options: EntitySaveOptions): Promise<void>;
159
+ protected OnAfterSaveExecute(entity: BaseEntity, user: UserInfo, options: EntitySaveOptions): void;
160
+ protected OnBeforeDeleteExecute(entity: BaseEntity, user: UserInfo, options: EntityDeleteOptions): Promise<void>;
161
+ protected OnAfterDeleteExecute(entity: BaseEntity, user: UserInfo, options: EntityDeleteOptions): void;
162
+ /**************************************************************************/
163
+ /**************************************************************************/
164
+ /**
165
+ * Post-processes rows: first applies platform-specific datetime adjustments
166
+ * via the virtual `AdjustDatetimeFields` hook, then handles field-level
167
+ * decryption for encrypted fields.
168
+ *
169
+ * Subclasses should NOT override this method. Instead, override
170
+ * `AdjustDatetimeFields` for platform-specific datetime corrections.
171
+ */
172
+ protected PostProcessRows(rows: Record<string, unknown>[], entityInfo: EntityInfo, user: UserInfo): Promise<Record<string, unknown>[]>;
173
+ /**
174
+ * Virtual hook for platform-specific datetime field adjustments.
175
+ * Default implementation is a no-op (returns rows unchanged).
176
+ *
177
+ * SQL Server overrides this to correct datetime2/datetimeoffset/datetime
178
+ * timezone interpretation issues in the mssql driver.
179
+ * PostgreSQL does NOT need to override — PG timestamp types are timezone-aware natively.
180
+ *
181
+ * @param rows The data rows to process
182
+ * @param datetimeFields Entity fields with TSType === Date
183
+ * @param entityInfo The entity metadata
184
+ * @returns The rows with datetime fields adjusted (or unchanged for default)
185
+ */
186
+ protected AdjustDatetimeFields(rows: Record<string, unknown>[], datetimeFields: EntityFieldInfo[], entityInfo: EntityInfo): Promise<Record<string, unknown>[]>;
187
+ /**************************************************************************/
188
+ /**************************************************************************/
189
+ /**
190
+ * Executes multiple SQL queries and returns an array of result arrays, one per query.
191
+ *
192
+ * The default implementation runs queries in parallel using `Promise.all(ExecuteSQL(...))`.
193
+ * Platform-specific providers can override for true multi-result-set batching:
194
+ * - SQL Server: concatenates queries and uses a single mssql request with multiple recordsets
195
+ * - PostgreSQL: could use pg pipeline or simple parallel execution
196
+ *
197
+ * @param queries Array of SQL query strings to execute
198
+ * @param parameters Optional array of parameter arrays, one per query
199
+ * @param options Optional batch execution options
200
+ * @param contextUser Optional user context for logging/filtering
201
+ * @returns Array of result arrays, one for each query
202
+ */
203
+ ExecuteSQLBatch(queries: string[], parameters?: unknown[][], options?: ExecuteSQLBatchOptions, contextUser?: UserInfo): Promise<Record<string, unknown>[][]>;
204
+ /**************************************************************************/
205
+ /**************************************************************************/
206
+ /**************************************************************************/
207
+ /**************************************************************************/
208
+ /**
209
+ * Builds a platform-specific pagination clause.
210
+ * SQL Server: `OFFSET X ROWS FETCH NEXT Y ROWS ONLY`
211
+ * PostgreSQL: `LIMIT Y OFFSET X`
212
+ */
213
+ protected abstract BuildPaginationSQL(maxRows: number, startRow: number): string;
214
+ /**
215
+ * Builds a platform-specific TOP/LIMIT clause for non-paginated row limits.
216
+ * SQL Server: `TOP N`; PostgreSQL returns empty (uses LIMIT via BuildPaginationSQL).
217
+ * Default: returns empty string. SQL Server overrides.
218
+ */
219
+ protected BuildTopClause(_maxRows: number): string;
220
+ /**
221
+ * Builds a platform-specific non-paginated row limit clause appended at end of query.
222
+ * SQL Server: returns '' (already handled by TOP in SELECT clause).
223
+ * PostgreSQL: returns `LIMIT N`.
224
+ * Default: returns empty string. PG overrides.
225
+ */
226
+ protected BuildNonPaginatedLimitSQL(_maxRows: number): string;
227
+ /**
228
+ * Transforms a user-provided SQL clause (ExtraFilter, OrderBy, etc.) for platform compatibility.
229
+ * PostgreSQL overrides to quote mixed-case identifiers and convert bracket notation.
230
+ * Default: returns the clause unchanged.
231
+ */
232
+ protected TransformExternalSQLClause(clause: string, _entityInfo: EntityInfo): string;
233
+ /**
234
+ * Optionally wraps a view query with user view run logging.
235
+ * SQL Server overrides to use spCreateUserViewRunWithDetail.
236
+ * Default: returns null (no view run logging).
237
+ */
238
+ protected executeSQLForUserViewRunLogging(_viewId: number, _entityBaseView: string, _whereSQL: string, _orderBySQL: string, _user: UserInfo): Promise<{
239
+ executeViewSQL: string;
240
+ runID: string;
241
+ } | null>;
242
+ /**
243
+ * Shared InternalRunView implementation.
244
+ * Handles: view resolution, permissions, field selection, WHERE clause building
245
+ * (view + extra filter + user search + exclude + RLS), ORDER BY, pagination,
246
+ * aggregates, parallel query execution, post-processing, and audit logging.
247
+ */
248
+ protected InternalRunView<T = unknown>(params: RunViewParams, contextUser?: UserInfo): Promise<RunViewResult<T>>;
249
+ protected InternalRunViews<T = unknown>(params: RunViewParams[], contextUser?: UserInfo): Promise<RunViewResult<T>[]>;
250
+ /**************************************************************************/
251
+ /**************************************************************************/
252
+ /**
253
+ * Builds the SQL field list string for a view query, using dialect-neutral quoting.
254
+ * Returns '*' if no specific fields are resolved.
255
+ */
256
+ protected getRunTimeViewFieldString(params: RunViewParams, viewEntity: MJUserViewEntityExtended | null): string;
257
+ /**
258
+ * Resolves the list of EntityFieldInfo objects for a view query.
259
+ * Priority: params.Fields > view columns > all entity fields (wildcard).
260
+ */
261
+ protected getRunTimeViewFieldArray(params: RunViewParams, viewEntity: MJUserViewEntityExtended | null): EntityFieldInfo[];
262
+ /**
263
+ * Builds user search SQL for the given entity and search string.
264
+ * Supports full-text search (if enabled) and field-by-field LIKE searching.
265
+ */
266
+ protected createViewUserSearchSQL(entityInfo: EntityInfo, userSearchString: string): string;
267
+ /**************************************************************************/
268
+ /**************************************************************************/
269
+ /**
270
+ * Renders the WHERE clause for a saved view, replacing template variables
271
+ * like {%UserView "viewId"%} with subquery SQL. Handles nested/recursive
272
+ * templates with circular reference detection.
273
+ *
274
+ * Uses QuoteIdentifier/QuoteSchemaAndView for dialect-neutral SQL generation.
275
+ */
276
+ protected RenderViewWhereClause(viewEntity: MJUserViewEntityExtended, user: UserInfo, stack?: string[]): Promise<string>;
277
+ /**************************************************************************/
278
+ /**************************************************************************/
279
+ /**
280
+ * Compares client cache status with server status to determine if cache is current.
281
+ * Checks both row count and maxUpdatedAt timestamp.
282
+ */
283
+ protected isCacheCurrent(clientStatus: {
284
+ maxUpdatedAt: string;
285
+ rowCount: number;
286
+ }, serverStatus: {
287
+ maxUpdatedAt?: string;
288
+ rowCount?: number;
289
+ }): boolean;
290
+ /**************************************************************************/
291
+ /**************************************************************************/
292
+ /**
293
+ * Smart cache validation for batch RunViews.
294
+ * For each view request, if cacheStatus is provided, checks if the cache is current
295
+ * by comparing MAX(__mj_UpdatedAt) and COUNT(*) with client's values.
296
+ * Returns 'current' if cache is valid (no data), 'stale' with fresh data, or 'differential'
297
+ * with only changed rows for entities that track record changes.
298
+ */
299
+ RunViewsWithCacheCheck<T = unknown>(params: RunViewWithCacheCheckParams[], contextUser?: UserInfo): Promise<RunViewsWithCacheCheckResponse<T>>;
300
+ /**
301
+ * Builds the WHERE clause for cache status check, using same logic as InternalRunView.
302
+ * Handles ExtraFilter, UserSearch, and Row-Level Security.
303
+ * Subclasses can override to add platform-specific SQL transformations (e.g., identifier quoting).
304
+ */
305
+ protected buildWhereClauseForCacheCheck(params: RunViewParams, entityInfo: EntityInfo, user: UserInfo): Promise<string>;
306
+ /**
307
+ * Executes cache status checks for multiple views.
308
+ * Default: parallel individual queries (works on all platforms).
309
+ * SQL Server overrides to use ExecuteSQLBatch for multi-result-set efficiency.
310
+ */
311
+ protected getBatchedServerCacheStatus(items: Array<{
312
+ index: number;
313
+ item: RunViewWithCacheCheckParams;
314
+ entityInfo: EntityInfo;
315
+ whereSQL: string;
316
+ }>, contextUser?: UserInfo): Promise<Map<number, {
317
+ success: boolean;
318
+ maxUpdatedAt?: string;
319
+ rowCount?: number;
320
+ errorMessage?: string;
321
+ }>>;
322
+ /**
323
+ * Runs a full view query and returns results with cache metadata.
324
+ */
325
+ protected runFullQueryAndReturn<T = unknown>(params: RunViewParams, viewIndex: number, contextUser?: UserInfo): Promise<RunViewWithCacheCheckResult<T>>;
326
+ /**
327
+ * Runs a differential query and returns only changes since the client's cached state.
328
+ * Includes updated/created rows and deleted record IDs.
329
+ * Falls back to full query if hidden deletes are detected.
330
+ */
331
+ protected runDifferentialQueryAndReturn<T = unknown>(params: RunViewParams, entityInfo: EntityInfo, clientMaxUpdatedAt: string, clientRowCount: number, serverStatus: {
332
+ maxUpdatedAt?: string;
333
+ rowCount?: number;
334
+ }, whereSQL: string, viewIndex: number, contextUser?: UserInfo): Promise<RunViewWithCacheCheckResult<T>>;
335
+ /**
336
+ * Gets IDs of records deleted since a given timestamp.
337
+ * Uses dialect-neutral quoting. Subclasses can override for parameterized queries.
338
+ */
339
+ protected getDeletedRecordIDsSince(entityID: string, sinceTimestamp: string, contextUser?: UserInfo): Promise<string[]>;
340
+ /**
341
+ * Gets rows updated/created since a given timestamp.
342
+ * Uses dialect-neutral quoting and TransformExternalSQLClause for OrderBy.
343
+ */
344
+ protected getUpdatedRowsSince<T = unknown>(params: RunViewParams, entityInfo: EntityInfo, sinceTimestamp: string, whereSQL: string, contextUser?: UserInfo): Promise<T[]>;
345
+ /**************************************************************************/
346
+ /**************************************************************************/
347
+ /**
348
+ * Smart cache validation for batch RunQueries.
349
+ * For each query, if cacheStatus is provided, checks CacheValidationSQL to determine staleness.
350
+ * Returns 'current' if cache is valid, 'stale' with fresh data, or 'no_validation' if
351
+ * the query has no CacheValidationSQL configured.
352
+ */
353
+ RunQueriesWithCacheCheck<T = unknown>(params: RunQueryWithCacheCheckParams[], contextUser?: UserInfo): Promise<RunQueriesWithCacheCheckResponse<T>>;
354
+ /**
355
+ * Resolves QueryInfo from RunQueryParams (by ID or Name+CategoryPath).
356
+ * Tries QueryEngine first for fresh data, falls back to ProviderBase cache.
357
+ */
358
+ protected resolveQueryInfo(params: RunQueryParams): QueryInfo | undefined;
359
+ /**
360
+ * Searches QueryEngine for a fresh query entity.
361
+ */
362
+ protected findQueryInEngine(QueryID: string | undefined, QueryName: string | undefined, CategoryID: string | undefined, CategoryPath: string | undefined): MJQueryEntity | null;
363
+ /**
364
+ * Creates a fresh QueryInfo from a MJQueryEntity and patches the ProviderBase cache.
365
+ */
366
+ protected refreshQueryInfoFromEntity(entity: MJQueryEntity): QueryInfo;
367
+ /**
368
+ * Resolves a category path string to a QueryCategoryInfo ID.
369
+ */
370
+ protected resolveCategoryPath(categoryPath: string): string | null;
371
+ /**
372
+ * Executes cache status checks for multiple queries using their CacheValidationSQL.
373
+ * Default: parallel individual queries. SQL Server overrides for batch execution.
374
+ */
375
+ protected getBatchedQueryCacheStatus(items: Array<{
376
+ index: number;
377
+ item: RunQueryWithCacheCheckParams;
378
+ queryInfo: QueryInfo;
379
+ }>, contextUser?: UserInfo): Promise<Map<number, {
380
+ success: boolean;
381
+ maxUpdatedAt?: string;
382
+ rowCount?: number;
383
+ errorMessage?: string;
384
+ }>>;
385
+ /**
386
+ * Runs a full query and returns results with cache metadata.
387
+ */
388
+ protected runFullQueryAndReturnForQuery<T = unknown>(params: RunQueryParams, queryIndex: number, status: 'stale' | 'no_validation', contextUser?: UserInfo, queryId?: string): Promise<RunQueryWithCacheCheckResult<T>>;
389
+ /**************************************************************************/
390
+ /**************************************************************************/
391
+ /**
392
+ * Loads a single entity record by composite key, with optional relationship loading.
393
+ * Uses dialect-neutral quoting for all SQL construction.
394
+ */
395
+ Load(entity: BaseEntity, compositeKey: CompositeKey, entityRelationshipsToLoad: string[] | null | undefined, user: UserInfo): Promise<Record<string, unknown> | null>;
396
+ /**************************************************************************/
397
+ /**************************************************************************/
398
+ /**
399
+ * Builds a parameter placeholder for parameterized queries.
400
+ * Default: PG-style ($1, $2, ...). SQL Server overrides to @p0, @p1, etc.
401
+ */
402
+ protected BuildParameterPlaceholder(index: number): string;
403
+ /**
404
+ * Retrieves a dataset by name, executing all item queries via ExecuteSQLBatch
405
+ * and aggregating results. Uses dialect-neutral quoting for all SQL construction.
406
+ *
407
+ * ExecuteSQLBatch gives SQL Server true multi-result-set batching automatically,
408
+ * while PG (and the default) use parallel individual queries.
409
+ */
410
+ GetDatasetByName(datasetName: string, itemFilters?: DatasetItemFilterType[], contextUser?: UserInfo, providerToUse?: IMetadataProvider): Promise<DatasetResultType>;
411
+ /**************************************************************************/
412
+ /**************************************************************************/
413
+ /**
414
+ * Retrieves status information for a dataset by name: per-entity row count and
415
+ * latest update date. Uses ExecuteSQLBatch for per-item status queries.
416
+ */
417
+ GetDatasetStatusByName(datasetName: string, itemFilters?: DatasetItemFilterType[], contextUser?: UserInfo, providerToUse?: IMetadataProvider): Promise<DatasetStatusResultType>;
418
+ /**************************************************************************/
419
+ /**************************************************************************/
420
+ /**
421
+ * Validates columns for a dataset item and returns the column list string.
422
+ * Returns null if columns are invalid.
423
+ */
424
+ protected getColumnsForDatasetItem(item: Record<string, unknown>, datasetName: string): string | null;
425
+ }
426
+ //# sourceMappingURL=GenericDatabaseProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericDatabaseProvider.d.ts","sourceRoot":"","sources":["../src/GenericDatabaseProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;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