@powersync/service-module-mssql 0.6.2 → 0.6.3
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/CHANGELOG.md +17 -0
- package/dist/api/MSSQLRouteAPIAdapter.d.ts +2 -2
- package/dist/api/MSSQLRouteAPIAdapter.js +3 -3
- package/dist/api/MSSQLRouteAPIAdapter.js.map +1 -1
- package/dist/common/MSSQLSourceTable.js +1 -1
- package/dist/common/MSSQLSourceTable.js.map +1 -1
- package/dist/common/MSSQLSourceTableCache.js.map +1 -1
- package/dist/common/mssqls-to-sqlite.d.ts +1 -1
- package/dist/common/mssqls-to-sqlite.js +1 -1
- package/dist/common/mssqls-to-sqlite.js.map +1 -1
- package/dist/module/MSSQLModule.js +4 -4
- package/dist/module/MSSQLModule.js.map +1 -1
- package/dist/replication/CDCPoller.d.ts +6 -6
- package/dist/replication/CDCPoller.js +3 -3
- package/dist/replication/CDCPoller.js.map +1 -1
- package/dist/replication/CDCReplicationJob.d.ts +1 -1
- package/dist/replication/CDCReplicationJob.js +2 -2
- package/dist/replication/CDCReplicationJob.js.map +1 -1
- package/dist/replication/CDCReplicator.d.ts +2 -2
- package/dist/replication/CDCReplicator.js +1 -1
- package/dist/replication/CDCReplicator.js.map +1 -1
- package/dist/replication/MSSQLConnectionManager.d.ts +1 -1
- package/dist/replication/MSSQLConnectionManager.js +1 -1
- package/dist/replication/MSSQLConnectionManager.js.map +1 -1
- package/dist/replication/MSSQLConnectionManagerFactory.d.ts +1 -1
- package/dist/replication/MSSQLConnectionManagerFactory.js.map +1 -1
- package/dist/replication/MSSQLSnapshotQuery.d.ts +1 -1
- package/dist/replication/MSSQLSnapshotQuery.js +2 -2
- package/dist/replication/MSSQLSnapshotQuery.js.map +1 -1
- package/dist/utils/mssql.d.ts +4 -4
- package/dist/utils/mssql.js +2 -2
- package/dist/utils/mssql.js.map +1 -1
- package/dist/utils/schema.js +1 -1
- package/dist/utils/schema.js.map +1 -1
- package/package.json +9 -9
- package/src/api/MSSQLRouteAPIAdapter.ts +4 -4
- package/src/common/MSSQLSourceTable.ts +1 -1
- package/src/common/MSSQLSourceTableCache.ts +1 -1
- package/src/common/mssqls-to-sqlite.ts +1 -1
- package/src/module/MSSQLModule.ts +4 -4
- package/src/replication/CDCPoller.ts +9 -9
- package/src/replication/CDCReplicationJob.ts +3 -3
- package/src/replication/CDCReplicator.ts +2 -2
- package/src/replication/MSSQLConnectionManager.ts +2 -2
- package/src/replication/MSSQLConnectionManagerFactory.ts +1 -1
- package/src/replication/MSSQLSnapshotQuery.ts +3 -3
- package/src/utils/mssql.ts +7 -7
- package/src/utils/schema.ts +2 -2
- package/test/src/CDCStream.test.ts +5 -5
- package/test/src/CDCStreamTestContext.ts +3 -3
- package/test/src/CDCStream_resumable_snapshot.test.ts +6 -6
- package/test/src/LSN.test.ts +1 -1
- package/test/src/mssql-to-sqlite.test.ts +11 -11
- package/test/src/schema-changes.test.ts +5 -5
- package/test/src/util.ts +4 -10
- package/tsconfig.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@powersync/service-module-mssql",
|
|
3
3
|
"repository": "https://github.com/powersync-ja/powersync-service",
|
|
4
4
|
"types": "dist/index.d.ts",
|
|
5
|
-
"version": "0.6.
|
|
5
|
+
"version": "0.6.3",
|
|
6
6
|
"license": "FSL-1.1-ALv2",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"type": "module",
|
|
@@ -27,20 +27,20 @@
|
|
|
27
27
|
"ts-codec": "^1.3.0",
|
|
28
28
|
"uri-js": "^4.4.1",
|
|
29
29
|
"uuid": "^11.1.0",
|
|
30
|
-
"@powersync/lib-services-framework": "0.9.
|
|
31
|
-
"@powersync/service-core": "1.20.
|
|
32
|
-
"@powersync/service-errors": "0.4.
|
|
30
|
+
"@powersync/lib-services-framework": "0.9.3",
|
|
31
|
+
"@powersync/service-core": "1.20.5",
|
|
32
|
+
"@powersync/service-errors": "0.4.2",
|
|
33
33
|
"@powersync/service-jsonbig": "0.17.12",
|
|
34
|
-
"@powersync/service-sync-rules": "0.
|
|
35
|
-
"@powersync/service-types": "0.15.
|
|
34
|
+
"@powersync/service-sync-rules": "0.35.0",
|
|
35
|
+
"@powersync/service-types": "0.15.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/mssql": "^9.1.9",
|
|
39
39
|
"@types/semver": "^7.7.1",
|
|
40
40
|
"@types/uuid": "^10.0.0",
|
|
41
|
-
"@powersync/service-core-tests": "0.15.
|
|
42
|
-
"@powersync/service-module-mongodb-storage": "0.15.
|
|
43
|
-
"@powersync/service-module-postgres-storage": "0.13.
|
|
41
|
+
"@powersync/service-core-tests": "0.15.4",
|
|
42
|
+
"@powersync/service-module-mongodb-storage": "0.15.4",
|
|
43
|
+
"@powersync/service-module-postgres-storage": "0.13.4"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "tsc -b",
|
|
@@ -5,11 +5,13 @@ import {
|
|
|
5
5
|
ReplicationHeadCallback,
|
|
6
6
|
ReplicationLagOptions
|
|
7
7
|
} from '@powersync/service-core';
|
|
8
|
-
import * as service_types from '@powersync/service-types';
|
|
9
8
|
import { SqlSyncRules, TablePattern } from '@powersync/service-sync-rules';
|
|
10
|
-
import * as
|
|
9
|
+
import * as service_types from '@powersync/service-types';
|
|
11
10
|
import { ExecuteSqlResponse } from '@powersync/service-types/dist/routes.js';
|
|
11
|
+
import sql from 'mssql';
|
|
12
|
+
import { toExpressionTypeFromMSSQLType } from '../common/mssqls-to-sqlite.js';
|
|
12
13
|
import { MSSQLConnectionManager } from '../replication/MSSQLConnectionManager.js';
|
|
14
|
+
import * as types from '../types/types.js';
|
|
13
15
|
import {
|
|
14
16
|
checkSourceConfiguration,
|
|
15
17
|
createCheckpoint,
|
|
@@ -18,8 +20,6 @@ import {
|
|
|
18
20
|
POWERSYNC_CHECKPOINTS_TABLE
|
|
19
21
|
} from '../utils/mssql.js';
|
|
20
22
|
import { getTablesFromPattern, ResolvedTable } from '../utils/schema.js';
|
|
21
|
-
import { toExpressionTypeFromMSSQLType } from '../common/mssqls-to-sqlite.js';
|
|
22
|
-
import sql from 'mssql';
|
|
23
23
|
|
|
24
24
|
export class MSSQLRouteAPIAdapter implements api.RouteAPI {
|
|
25
25
|
protected connectionManager: MSSQLConnectionManager;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SourceTable } from '@powersync/service-core';
|
|
2
|
-
import { toQualifiedTableName } from '../utils/mssql.js';
|
|
3
2
|
import { ServiceAssertionError } from '@powersync/service-errors';
|
|
3
|
+
import { toQualifiedTableName } from '../utils/mssql.js';
|
|
4
4
|
import { CaptureInstance } from './CaptureInstance.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SourceTable } from '@powersync/service-core';
|
|
2
|
-
import { MSSQLSourceTable } from './MSSQLSourceTable.js';
|
|
3
2
|
import { ServiceAssertionError } from '@powersync/service-errors';
|
|
3
|
+
import { MSSQLSourceTable } from './MSSQLSourceTable.js';
|
|
4
4
|
|
|
5
5
|
export class MSSQLSourceTableCache {
|
|
6
6
|
private cache = new Map<number | string, MSSQLSourceTable>();
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import sql from 'mssql';
|
|
2
1
|
import {
|
|
3
2
|
DatabaseInputRow,
|
|
4
3
|
DateTimeSourceOptions,
|
|
@@ -11,6 +10,7 @@ import {
|
|
|
11
10
|
TimeValuePrecision,
|
|
12
11
|
toSyncRulesRow
|
|
13
12
|
} from '@powersync/service-sync-rules';
|
|
13
|
+
import sql from 'mssql';
|
|
14
14
|
import { MSSQLUserDefinedType } from '../types/mssql-data-types.js';
|
|
15
15
|
|
|
16
16
|
export function toSqliteInputRow(row: any, columns: sql.IColumnMetadata): SqliteInputRow {
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
system,
|
|
7
7
|
TearDownOptions
|
|
8
8
|
} from '@powersync/service-core';
|
|
9
|
-
import {
|
|
10
|
-
import * as types from '../types/types.js';
|
|
9
|
+
import { MSSQLRouteAPIAdapter } from '../api/MSSQLRouteAPIAdapter.js';
|
|
11
10
|
import { CDCReplicator } from '../replication/CDCReplicator.js';
|
|
12
11
|
import { MSSQLConnectionManager } from '../replication/MSSQLConnectionManager.js';
|
|
13
|
-
import {
|
|
12
|
+
import { MSSQLConnectionManagerFactory } from '../replication/MSSQLConnectionManagerFactory.js';
|
|
14
13
|
import { MSSQLErrorRateLimiter } from '../replication/MSSQLErrorRateLimiter.js';
|
|
15
|
-
import
|
|
14
|
+
import * as types from '../types/types.js';
|
|
15
|
+
import { checkSourceConfiguration } from '../utils/mssql.js';
|
|
16
16
|
|
|
17
17
|
export class MSSQLModule extends replication.ReplicationModule<types.MSSQLConnectionConfig> {
|
|
18
18
|
constructor() {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DatabaseQueryError,
|
|
3
|
+
logger as defaultLogger,
|
|
3
4
|
ErrorCode,
|
|
4
5
|
Logger,
|
|
5
|
-
logger as defaultLogger,
|
|
6
6
|
ReplicationAssertionError
|
|
7
7
|
} from '@powersync/lib-services-framework';
|
|
8
|
+
import { SourceEntityDescriptor } from '@powersync/service-core';
|
|
9
|
+
import { TablePattern } from '@powersync/service-sync-rules';
|
|
10
|
+
import sql from 'mssql';
|
|
8
11
|
import timers from 'timers/promises';
|
|
9
|
-
import {
|
|
10
|
-
import { MSSQLSourceTable } from '../common/MSSQLSourceTable.js';
|
|
12
|
+
import { CaptureInstance } from '../common/CaptureInstance.js';
|
|
11
13
|
import { LSN } from '../common/LSN.js';
|
|
12
|
-
import
|
|
13
|
-
import { CaptureInstanceDetails, getCaptureInstances, incrementLSN, toQualifiedTableName } from '../utils/mssql.js';
|
|
14
|
-
import { isDeadlockError } from '../utils/deadlock.js';
|
|
14
|
+
import { MSSQLSourceTable } from '../common/MSSQLSourceTable.js';
|
|
15
15
|
import { AdditionalConfig } from '../types/types.js';
|
|
16
|
+
import { isDeadlockError } from '../utils/deadlock.js';
|
|
17
|
+
import { CaptureInstanceDetails, getCaptureInstances, incrementLSN, toQualifiedTableName } from '../utils/mssql.js';
|
|
16
18
|
import { tableExists } from '../utils/schema.js';
|
|
17
|
-
import {
|
|
18
|
-
import { CaptureInstance } from '../common/CaptureInstance.js';
|
|
19
|
-
import { SourceEntityDescriptor } from '@powersync/service-core';
|
|
19
|
+
import { MSSQLConnectionManager } from './MSSQLConnectionManager.js';
|
|
20
20
|
|
|
21
21
|
enum Operation {
|
|
22
22
|
DELETE = 1,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { replication } from '@powersync/service-core';
|
|
2
|
-
import { MSSQLConnectionManagerFactory } from './MSSQLConnectionManagerFactory.js';
|
|
3
1
|
import { container, logger as defaultLogger } from '@powersync/lib-services-framework';
|
|
4
|
-
import {
|
|
2
|
+
import { replication } from '@powersync/service-core';
|
|
5
3
|
import { AdditionalConfig } from '../types/types.js';
|
|
6
4
|
import { POWERSYNC_CHECKPOINTS_TABLE } from '../utils/mssql.js';
|
|
5
|
+
import { CDCDataExpiredError, CDCStream } from './CDCStream.js';
|
|
6
|
+
import { MSSQLConnectionManagerFactory } from './MSSQLConnectionManagerFactory.js';
|
|
7
7
|
|
|
8
8
|
export interface CDCReplicationJobOptions extends replication.AbstractReplicationJobOptions {
|
|
9
9
|
connectionFactory: MSSQLConnectionManagerFactory;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { replication, storage } from '@powersync/service-core';
|
|
2
|
-
import { MSSQLConnectionManagerFactory } from './MSSQLConnectionManagerFactory.js';
|
|
3
|
-
import { CDCReplicationJob } from './CDCReplicationJob.js';
|
|
4
2
|
import { MSSQLModule } from '../module/MSSQLModule.js';
|
|
5
3
|
import { AdditionalConfig } from '../types/types.js';
|
|
4
|
+
import { CDCReplicationJob } from './CDCReplicationJob.js';
|
|
5
|
+
import { MSSQLConnectionManagerFactory } from './MSSQLConnectionManagerFactory.js';
|
|
6
6
|
|
|
7
7
|
export interface CDCReplicatorOptions extends replication.AbstractReplicatorOptions {
|
|
8
8
|
connectionFactory: MSSQLConnectionManagerFactory;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseObserver, logger } from '@powersync/lib-services-framework';
|
|
2
|
-
import sql from 'mssql';
|
|
3
|
-
import { NormalizedMSSQLConnectionConfig } from '../types/types.js';
|
|
4
2
|
import { POWERSYNC_VERSION } from '@powersync/service-core';
|
|
3
|
+
import sql from 'mssql';
|
|
5
4
|
import { MSSQLParameter } from '../types/mssql-data-types.js';
|
|
5
|
+
import { NormalizedMSSQLConnectionConfig } from '../types/types.js';
|
|
6
6
|
import { addParameters } from '../utils/mssql.js';
|
|
7
7
|
|
|
8
8
|
export const DEFAULT_SCHEMA = 'dbo';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { logger } from '@powersync/lib-services-framework';
|
|
2
|
+
import sql from 'mssql';
|
|
2
3
|
import { ResolvedMSSQLConnectionConfig } from '../types/types.js';
|
|
3
4
|
import { MSSQLConnectionManager } from './MSSQLConnectionManager.js';
|
|
4
|
-
import sql from 'mssql';
|
|
5
5
|
|
|
6
6
|
export class MSSQLConnectionManagerFactory {
|
|
7
7
|
private readonly connectionManagers: Set<MSSQLConnectionManager>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { bson, ColumnDescriptor, SourceTable } from '@powersync/service-core';
|
|
2
1
|
import { ServiceAssertionError } from '@powersync/lib-services-framework';
|
|
3
|
-
import {
|
|
2
|
+
import { bson, ColumnDescriptor, SourceTable } from '@powersync/service-core';
|
|
4
3
|
import sql from 'mssql';
|
|
5
|
-
import { escapeIdentifier } from '../utils/mssql.js';
|
|
6
4
|
import { MSSQLSourceTable } from '../common/MSSQLSourceTable.js';
|
|
5
|
+
import { MSSQLBaseType } from '../types/mssql-data-types.js';
|
|
6
|
+
import { escapeIdentifier } from '../utils/mssql.js';
|
|
7
7
|
|
|
8
8
|
export interface MSSQLSnapshotQuery {
|
|
9
9
|
initialize(): Promise<void>;
|
package/src/utils/mssql.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
+
import { logger } from '@powersync/lib-services-framework';
|
|
2
|
+
import * as sync_rules from '@powersync/service-sync-rules';
|
|
3
|
+
import { SqlSyncRules, TablePattern } from '@powersync/service-sync-rules';
|
|
4
|
+
import * as service_types from '@powersync/service-types';
|
|
1
5
|
import sql from 'mssql';
|
|
2
6
|
import { coerce, gte } from 'semver';
|
|
3
|
-
import {
|
|
4
|
-
import { retryOnDeadlock } from './deadlock.js';
|
|
5
|
-
import { MSSQLConnectionManager } from '../replication/MSSQLConnectionManager.js';
|
|
7
|
+
import { CaptureInstance } from '../common/CaptureInstance.js';
|
|
6
8
|
import { LSN } from '../common/LSN.js';
|
|
7
9
|
import { MSSQLSourceTable } from '../common/MSSQLSourceTable.js';
|
|
10
|
+
import { MSSQLConnectionManager } from '../replication/MSSQLConnectionManager.js';
|
|
8
11
|
import { MSSQLParameter } from '../types/mssql-data-types.js';
|
|
9
|
-
import
|
|
10
|
-
import { SqlSyncRules, TablePattern } from '@powersync/service-sync-rules';
|
|
12
|
+
import { retryOnDeadlock } from './deadlock.js';
|
|
11
13
|
import {
|
|
12
14
|
getPendingSchemaChanges,
|
|
13
15
|
getReplicationIdentityColumns,
|
|
14
16
|
ReplicationIdentityColumnsResult,
|
|
15
17
|
ResolvedTable
|
|
16
18
|
} from './schema.js';
|
|
17
|
-
import * as service_types from '@powersync/service-types';
|
|
18
|
-
import { CaptureInstance } from '../common/CaptureInstance.js';
|
|
19
19
|
|
|
20
20
|
export const POWERSYNC_CHECKPOINTS_TABLE = '_powersync_checkpoints';
|
|
21
21
|
|
package/src/utils/schema.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { logger } from '@powersync/lib-services-framework';
|
|
1
2
|
import { SourceEntityDescriptor } from '@powersync/service-core';
|
|
2
3
|
import { TablePattern } from '@powersync/service-sync-rules';
|
|
4
|
+
import sql from 'mssql';
|
|
3
5
|
import { MSSQLConnectionManager } from '../replication/MSSQLConnectionManager.js';
|
|
4
6
|
import { MSSQLColumnDescriptor } from '../types/mssql-data-types.js';
|
|
5
|
-
import sql from 'mssql';
|
|
6
|
-
import { logger } from '@powersync/lib-services-framework';
|
|
7
7
|
|
|
8
8
|
export interface GetColumnsOptions {
|
|
9
9
|
connectionManager: MSSQLConnectionManager;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getLatestLSN } from '@module/utils/mssql.js';
|
|
2
|
+
import { storage } from '@powersync/service-core';
|
|
2
3
|
import { METRICS_HELPER, putOp, removeOp } from '@powersync/service-core-tests';
|
|
3
4
|
import { ReplicationMetric } from '@powersync/service-types';
|
|
4
|
-
import { createTestTable, describeWithStorage, insertTestData, waitForPendingCDCChanges } from './util.js';
|
|
5
|
-
import { storage } from '@powersync/service-core';
|
|
6
|
-
import { CDCStreamTestContext } from './CDCStreamTestContext.js';
|
|
7
|
-
import { getLatestLSN } from '@module/utils/mssql.js';
|
|
8
5
|
import sql from 'mssql';
|
|
6
|
+
import { describe, expect, test } from 'vitest';
|
|
7
|
+
import { CDCStreamTestContext } from './CDCStreamTestContext.js';
|
|
8
|
+
import { createTestTable, describeWithStorage, insertTestData, waitForPendingCDCChanges } from './util.js';
|
|
9
9
|
|
|
10
10
|
const BASIC_SYNC_RULES = `
|
|
11
11
|
bucket_definitions:
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CDCStream, CDCStreamOptions } from '@module/replication/CDCStream.js';
|
|
2
|
+
import { MSSQLConnectionManager } from '@module/replication/MSSQLConnectionManager.js';
|
|
1
3
|
import {
|
|
2
4
|
BucketStorageFactory,
|
|
3
5
|
createCoreReplicationMetrics,
|
|
@@ -10,10 +12,8 @@ import {
|
|
|
10
12
|
updateSyncRulesFromYaml
|
|
11
13
|
} from '@powersync/service-core';
|
|
12
14
|
import { bucketRequest, METRICS_HELPER, test_utils } from '@powersync/service-core-tests';
|
|
13
|
-
import { clearTestDb, getClientCheckpoint, TEST_CONNECTION_OPTIONS } from './util.js';
|
|
14
|
-
import { CDCStream, CDCStreamOptions } from '@module/replication/CDCStream.js';
|
|
15
|
-
import { MSSQLConnectionManager } from '@module/replication/MSSQLConnectionManager.js';
|
|
16
15
|
import timers from 'timers/promises';
|
|
16
|
+
import { clearTestDb, getClientCheckpoint, TEST_CONNECTION_OPTIONS } from './util.js';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Tests operating on the change data capture need to configure the stream and manage asynchronous
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { TestStorageConfig, TestStorageFactory } from '@powersync/service-core';
|
|
1
|
+
import { getLatestLSN } from '@module/utils/mssql.js';
|
|
2
|
+
import { logger, ReplicationAbortedError } from '@powersync/lib-services-framework';
|
|
3
|
+
import { TestStorageConfig } from '@powersync/service-core';
|
|
5
4
|
import { METRICS_HELPER } from '@powersync/service-core-tests';
|
|
6
5
|
import { ReplicationMetric } from '@powersync/service-types';
|
|
7
6
|
import * as timers from 'node:timers/promises';
|
|
8
|
-
import {
|
|
7
|
+
import { describe, expect, test } from 'vitest';
|
|
9
8
|
import { CDCStreamTestContext } from './CDCStreamTestContext.js';
|
|
10
|
-
import {
|
|
9
|
+
import { env } from './env.js';
|
|
10
|
+
import { createTestTableWithBasicId, describeWithStorage, waitForPendingCDCChanges } from './util.js';
|
|
11
11
|
|
|
12
12
|
describe.skipIf(!(env.CI || env.SLOW_TESTS))('batch replication', function () {
|
|
13
13
|
describeWithStorage({ timeout: 240_000 }, function (config) {
|
package/test/src/LSN.test.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import { CDCToSqliteRow, toSqliteInputRow } from '@module/common/mssqls-to-sqlite.js';
|
|
2
|
+
import { CDC_SCHEMA } from '@module/common/MSSQLSourceTable.js';
|
|
3
|
+
import { MSSQLConnectionManager } from '@module/replication/MSSQLConnectionManager.js';
|
|
4
|
+
import {
|
|
5
|
+
escapeIdentifier,
|
|
6
|
+
getCaptureInstances,
|
|
7
|
+
getLatestLSN,
|
|
8
|
+
getLatestReplicatedLSN,
|
|
9
|
+
toQualifiedTableName
|
|
10
|
+
} from '@module/utils/mssql.js';
|
|
1
11
|
import {
|
|
2
12
|
applyRowContext,
|
|
3
13
|
CompatibilityContext,
|
|
@@ -5,6 +15,7 @@ import {
|
|
|
5
15
|
SqliteInputRow,
|
|
6
16
|
TimeValuePrecision
|
|
7
17
|
} from '@powersync/service-sync-rules';
|
|
18
|
+
import sql from 'mssql';
|
|
8
19
|
import { afterAll, beforeEach, describe, expect, test } from 'vitest';
|
|
9
20
|
import {
|
|
10
21
|
clearTestDb,
|
|
@@ -13,17 +24,6 @@ import {
|
|
|
13
24
|
TEST_CONNECTION_OPTIONS,
|
|
14
25
|
waitForPendingCDCChanges
|
|
15
26
|
} from './util.js';
|
|
16
|
-
import { CDCToSqliteRow, toSqliteInputRow } from '@module/common/mssqls-to-sqlite.js';
|
|
17
|
-
import { MSSQLConnectionManager } from '@module/replication/MSSQLConnectionManager.js';
|
|
18
|
-
import {
|
|
19
|
-
escapeIdentifier,
|
|
20
|
-
getCaptureInstances,
|
|
21
|
-
getLatestLSN,
|
|
22
|
-
getLatestReplicatedLSN,
|
|
23
|
-
toQualifiedTableName
|
|
24
|
-
} from '@module/utils/mssql.js';
|
|
25
|
-
import sql from 'mssql';
|
|
26
|
-
import { CDC_SCHEMA } from '@module/common/MSSQLSourceTable.js';
|
|
27
27
|
|
|
28
28
|
describe('MSSQL Data Types Tests', () => {
|
|
29
29
|
const connectionManager = new MSSQLConnectionManager(TEST_CONNECTION_OPTIONS, {});
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { putOp, removeOp } from '@powersync/service-core-tests';
|
|
2
|
-
import { describe, expect, test, vi } from 'vitest';
|
|
3
1
|
import { storage } from '@powersync/service-core';
|
|
2
|
+
import { putOp, removeOp } from '@powersync/service-core-tests';
|
|
4
3
|
import sql from 'mssql';
|
|
4
|
+
import { describe, expect, test, vi } from 'vitest';
|
|
5
5
|
|
|
6
|
+
import { SchemaChangeType } from '@module/replication/CDCPoller.js';
|
|
7
|
+
import { getLatestLSN, toQualifiedTableName } from '@module/utils/mssql.js';
|
|
8
|
+
import { logger } from '@powersync/lib-services-framework';
|
|
6
9
|
import { CDCStreamTestContext } from './CDCStreamTestContext.js';
|
|
7
10
|
import {
|
|
8
11
|
createTestTableWithBasicId,
|
|
@@ -14,9 +17,6 @@ import {
|
|
|
14
17
|
renameTable,
|
|
15
18
|
waitForPendingCDCChanges
|
|
16
19
|
} from './util.js';
|
|
17
|
-
import { getLatestLSN, toQualifiedTableName } from '@module/utils/mssql.js';
|
|
18
|
-
import { SchemaChangeType } from '@module/replication/CDCPoller.js';
|
|
19
|
-
import { logger } from '@powersync/lib-services-framework';
|
|
20
20
|
|
|
21
21
|
describe('MSSQL Schema Changes Tests', () => {
|
|
22
22
|
describeWithStorage({ timeout: 60_000 }, defineSchemaChangesTests);
|
package/test/src/util.ts
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import * as types from '@module/types/types.js';
|
|
2
2
|
import { logger } from '@powersync/lib-services-framework';
|
|
3
|
-
import {
|
|
4
|
-
BucketStorageFactory,
|
|
5
|
-
InternalOpId,
|
|
6
|
-
ReplicationCheckpoint,
|
|
7
|
-
TestStorageConfig,
|
|
8
|
-
TestStorageFactory
|
|
9
|
-
} from '@powersync/service-core';
|
|
3
|
+
import { BucketStorageFactory, InternalOpId, ReplicationCheckpoint, TestStorageConfig } from '@powersync/service-core';
|
|
10
4
|
|
|
11
5
|
import * as mongo_storage from '@powersync/service-module-mongodb-storage';
|
|
12
6
|
import * as postgres_storage from '@powersync/service-module-postgres-storage';
|
|
13
7
|
|
|
14
|
-
import {
|
|
15
|
-
import { env } from './env.js';
|
|
8
|
+
import { LSN } from '@module/common/LSN.js';
|
|
16
9
|
import { MSSQLConnectionManager } from '@module/replication/MSSQLConnectionManager.js';
|
|
17
10
|
import { createCheckpoint, escapeIdentifier, getLatestLSN, toQualifiedTableName } from '@module/utils/mssql.js';
|
|
18
11
|
import sql from 'mssql';
|
|
19
12
|
import { v4 as uuid } from 'uuid';
|
|
20
|
-
import {
|
|
13
|
+
import { describe, TestOptions } from 'vitest';
|
|
14
|
+
import { env } from './env.js';
|
|
21
15
|
|
|
22
16
|
export const TEST_URI = env.MSSQL_TEST_URI;
|
|
23
17
|
|