@shivaedev/server 0.24.1 → 0.25.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/CHANGELOG.md +18 -0
- package/README.md +15 -9
- package/dist/AppHostFactory.d.ts +5 -5
- package/dist/AppHostFactory.d.ts.map +1 -1
- package/dist/AppHostInput.d.ts +16 -8
- package/dist/AppHostInput.d.ts.map +1 -1
- package/dist/appDatabase.d.ts +8 -3
- package/dist/appDatabase.d.ts.map +1 -1
- package/dist/appDatabase.js +16 -44
- package/dist/appDatabase.js.map +1 -1
- package/dist/appDatabaseHttp.d.ts +239 -0
- package/dist/appDatabaseHttp.d.ts.map +1 -0
- package/dist/appDatabaseHttp.js +10 -0
- package/dist/appDatabaseHttp.js.map +1 -0
- package/dist/appHost.d.ts +120 -18
- package/dist/appHost.d.ts.map +1 -1
- package/dist/appHost.js +7 -17
- package/dist/appHost.js.map +1 -1
- package/dist/appHostHttp.d.ts +0 -235
- package/dist/appHostHttp.d.ts.map +1 -1
- package/dist/appHostHttp.js +0 -7
- package/dist/appHostHttp.js.map +1 -1
- package/dist/hostOptions.d.ts +1 -2
- package/dist/hostOptions.d.ts.map +1 -1
- package/dist/hostPreflight.d.ts +9 -0
- package/dist/hostPreflight.d.ts.map +1 -0
- package/dist/hostPreflight.js +6 -0
- package/dist/hostPreflight.js.map +1 -0
- package/dist/prepareMigrations.d.ts +5 -0
- package/dist/prepareMigrations.d.ts.map +1 -0
- package/dist/prepareMigrations.js +46 -0
- package/dist/prepareMigrations.js.map +1 -0
- package/dist/workerHost.d.ts +1 -1
- package/dist/workerHost.d.ts.map +1 -1
- package/dist/workerHost.js.map +1 -1
- package/package.json +26 -26
- package/src/AppHostFactory.ts +5 -9
- package/src/AppHostInput.ts +53 -7
- package/src/appDatabase.ts +64 -54
- package/src/appDatabaseHttp.ts +78 -0
- package/src/appHost.ts +46 -79
- package/src/appHostHttp.ts +0 -74
- package/src/hostOptions.ts +1 -2
- package/src/hostPreflight.ts +22 -0
- package/src/prepareMigrations.ts +57 -0
- package/src/workerHost.ts +1 -2
package/src/appHost.ts
CHANGED
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
import * as NodeCrypto from "@effect/platform-node/NodeCrypto";
|
|
2
|
-
import {
|
|
2
|
+
import { Layer } from "effect";
|
|
3
3
|
import type { Rpc } from "effect/rpc";
|
|
4
|
-
import {
|
|
5
|
-
import type { AppHostFactory } from "#AppHostFactory.ts";
|
|
6
|
-
import type { AppHostInput, HostPreflight } from "#AppHostInput.ts";
|
|
7
|
-
import { appDatabase, type DatabaseConfig } from "#appDatabase.ts";
|
|
8
|
-
import { appHostHttp, deferredHost, migratedHost } from "#appHostHttp.ts";
|
|
4
|
+
import { appHostHttp } from "#appHostHttp.ts";
|
|
9
5
|
import type { HostCoreOptions, HostPolicy, HostRouteRequirements, HostRoutes } from "#hostOptions.ts";
|
|
6
|
+
import type { HostPreflight } from "#hostPreflight.ts";
|
|
7
|
+
import { hostPreflight } from "#hostPreflight.ts";
|
|
10
8
|
import { hostSensitiveKeys } from "#hostSensitiveKeys.ts";
|
|
11
|
-
import type { MigrationOptions } from "#MigrationOptions.ts";
|
|
12
|
-
import { redactingDiagnostics } from "#redactingDiagnostics.ts";
|
|
13
9
|
|
|
14
|
-
export
|
|
15
|
-
readonly config?: DatabaseConfig;
|
|
16
|
-
readonly migrations: MigrationOptions<R, E>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type AppHostOptions<
|
|
10
|
+
export type AppHttpHostOptions<
|
|
20
11
|
TRpcs extends Rpc.Any = never,
|
|
21
12
|
THandlers = never,
|
|
22
13
|
THandlerError = never,
|
|
@@ -24,22 +15,16 @@ export type AppHostOptions<
|
|
|
24
15
|
TServices = never,
|
|
25
16
|
TServiceError = never,
|
|
26
17
|
TServiceRequirements = never,
|
|
27
|
-
TMigrations = never,
|
|
28
18
|
TPreflight = never,
|
|
29
19
|
TPreflightError = never,
|
|
30
20
|
TPreflightRequirements = never,
|
|
31
21
|
TRouteError = never,
|
|
32
22
|
TRouteRequirements = HostRouteRequirements,
|
|
33
|
-
TMigrationError = never,
|
|
34
23
|
> = HostPreflight<TPreflight, TPreflightError, TPreflightRequirements> &
|
|
35
24
|
HostCoreOptions<TRpcs, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements> &
|
|
36
25
|
HostRoutes<TRouteError, TRouteRequirements> &
|
|
37
|
-
HostPolicy & {
|
|
38
|
-
|
|
39
|
-
readonly policy?: undefined;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export type AppLocalHostOptions<
|
|
26
|
+
HostPolicy & { readonly migrations?: undefined };
|
|
27
|
+
function buildHttpHost<
|
|
43
28
|
TRpcs extends Rpc.Any = never,
|
|
44
29
|
THandlers = never,
|
|
45
30
|
THandlerError = never,
|
|
@@ -47,22 +32,31 @@ export type AppLocalHostOptions<
|
|
|
47
32
|
TServices = never,
|
|
48
33
|
TServiceError = never,
|
|
49
34
|
TServiceRequirements = never,
|
|
50
|
-
TMigrations = never,
|
|
51
35
|
TPreflight = never,
|
|
52
36
|
TPreflightError = never,
|
|
53
37
|
TPreflightRequirements = never,
|
|
54
38
|
TRouteError = never,
|
|
55
39
|
TRouteRequirements = HostRouteRequirements,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
40
|
+
>(
|
|
41
|
+
options: AppHttpHostOptions<
|
|
42
|
+
TRpcs,
|
|
43
|
+
THandlers,
|
|
44
|
+
THandlerError,
|
|
45
|
+
THandlerRequirements,
|
|
46
|
+
TServices,
|
|
47
|
+
TServiceError,
|
|
48
|
+
TServiceRequirements,
|
|
49
|
+
TPreflight,
|
|
50
|
+
TPreflightError,
|
|
51
|
+
TPreflightRequirements,
|
|
52
|
+
TRouteError,
|
|
53
|
+
TRouteRequirements
|
|
54
|
+
>,
|
|
55
|
+
) {
|
|
56
|
+
return appHostHttp(options).pipe(Layer.provideMerge(hostPreflight(options.preflight, hostSensitiveKeys(options))), Layer.provide(NodeCrypto.layer));
|
|
57
|
+
}
|
|
64
58
|
|
|
65
|
-
|
|
59
|
+
type HttpHostFactory = <
|
|
66
60
|
TRpcs extends Rpc.Any = never,
|
|
67
61
|
THandlers = never,
|
|
68
62
|
THandlerError = never,
|
|
@@ -75,29 +69,8 @@ export type AppHttpHostOptions<
|
|
|
75
69
|
TPreflightRequirements = never,
|
|
76
70
|
TRouteError = never,
|
|
77
71
|
TRouteRequirements = HostRouteRequirements,
|
|
78
|
-
> = HostPreflight<TPreflight, TPreflightError, TPreflightRequirements> &
|
|
79
|
-
HostCoreOptions<TRpcs, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements> &
|
|
80
|
-
HostRoutes<TRouteError, TRouteRequirements> &
|
|
81
|
-
HostPolicy & { readonly migrations?: undefined };
|
|
82
|
-
export const appHost: AppHostFactory = <
|
|
83
|
-
TRpcs extends Rpc.Any = never,
|
|
84
|
-
THandlers = never,
|
|
85
|
-
THandlerError = never,
|
|
86
|
-
THandlerRequirements = never,
|
|
87
|
-
TServices = never,
|
|
88
|
-
TServiceError = never,
|
|
89
|
-
TServiceRequirements = never,
|
|
90
|
-
TMigrations = never,
|
|
91
|
-
TApplicationError = never,
|
|
92
|
-
TApplicationRequirements = never,
|
|
93
|
-
TPreflight = never,
|
|
94
|
-
TPreflightError = never,
|
|
95
|
-
TPreflightRequirements = never,
|
|
96
|
-
TRouteError = never,
|
|
97
|
-
TRouteRequirements = HostRouteRequirements,
|
|
98
|
-
TMigrationError = never,
|
|
99
72
|
>(
|
|
100
|
-
options:
|
|
73
|
+
options: AppHttpHostOptions<
|
|
101
74
|
TRpcs,
|
|
102
75
|
THandlers,
|
|
103
76
|
THandlerError,
|
|
@@ -105,33 +78,27 @@ export const appHost: AppHostFactory = <
|
|
|
105
78
|
TServices,
|
|
106
79
|
TServiceError,
|
|
107
80
|
TServiceRequirements,
|
|
108
|
-
TMigrations,
|
|
109
|
-
TApplicationError,
|
|
110
|
-
TApplicationRequirements,
|
|
111
81
|
TPreflight,
|
|
112
82
|
TPreflightError,
|
|
113
83
|
TPreflightRequirements,
|
|
114
84
|
TRouteError,
|
|
115
|
-
TRouteRequirements
|
|
116
|
-
TMigrationError
|
|
85
|
+
TRouteRequirements
|
|
117
86
|
>,
|
|
118
|
-
) =>
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
);
|
|
137
|
-
};
|
|
87
|
+
) => ReturnType<
|
|
88
|
+
typeof buildHttpHost<
|
|
89
|
+
TRpcs,
|
|
90
|
+
THandlers,
|
|
91
|
+
THandlerError,
|
|
92
|
+
THandlerRequirements,
|
|
93
|
+
TServices,
|
|
94
|
+
TServiceError,
|
|
95
|
+
TServiceRequirements,
|
|
96
|
+
NoInfer<TPreflight>,
|
|
97
|
+
NoInfer<TPreflightError>,
|
|
98
|
+
NoInfer<TPreflightRequirements>,
|
|
99
|
+
TRouteError,
|
|
100
|
+
TRouteRequirements
|
|
101
|
+
>
|
|
102
|
+
>;
|
|
103
|
+
|
|
104
|
+
export const appHost: HttpHostFactory = buildHttpHost;
|
package/src/appHostHttp.ts
CHANGED
|
@@ -3,8 +3,6 @@ import { HttpRouter, HttpServer } from "effect/http";
|
|
|
3
3
|
import type { Rpc } from "effect/rpc";
|
|
4
4
|
import { hostHttpServices } from "#adapters/hostHttpServices.ts";
|
|
5
5
|
import { nodeHttpServer } from "#adapters/nodeHttpServer.ts";
|
|
6
|
-
import type { appDatabase } from "#appDatabase.ts";
|
|
7
|
-
import type { AppHttpHostOptions } from "#appHost.ts";
|
|
8
6
|
import { browserErrorRoute } from "#browserErrorRoute.ts";
|
|
9
7
|
import { healthRoute } from "#healthRoute.ts";
|
|
10
8
|
import { hostApplicationRoutes } from "#hostApplicationRoutes.ts";
|
|
@@ -13,7 +11,6 @@ import type { HostOptions, HostPolicy, HostRouteRequirements } from "#hostOption
|
|
|
13
11
|
import { hostRpcRoutes } from "#hostRpcRoutes.ts";
|
|
14
12
|
import { hostSensitiveKeys } from "#hostSensitiveKeys.ts";
|
|
15
13
|
import { hostTransport } from "#hostTransport.ts";
|
|
16
|
-
import type { MigrationOptions } from "#MigrationOptions.ts";
|
|
17
14
|
import { nativeClientOrigins } from "#nativeClientOrigins.ts";
|
|
18
15
|
import { otlpTracing } from "#otlpTracing.ts";
|
|
19
16
|
import { RedactionPolicy } from "#RedactionPolicy.ts";
|
|
@@ -75,74 +72,3 @@ export function appHostHttp<
|
|
|
75
72
|
),
|
|
76
73
|
);
|
|
77
74
|
}
|
|
78
|
-
|
|
79
|
-
export function migratedHost<
|
|
80
|
-
TRpcs extends Rpc.Any,
|
|
81
|
-
THandlers,
|
|
82
|
-
THandlerError,
|
|
83
|
-
THandlerRequirements,
|
|
84
|
-
TServices,
|
|
85
|
-
TServiceError,
|
|
86
|
-
TServiceRequirements,
|
|
87
|
-
TMigrations,
|
|
88
|
-
TRouteError = never,
|
|
89
|
-
TRouteRequirements = HostRouteRequirements,
|
|
90
|
-
TMigrationError = never,
|
|
91
|
-
>(
|
|
92
|
-
options: HostOptions<
|
|
93
|
-
TRpcs,
|
|
94
|
-
THandlers,
|
|
95
|
-
THandlerError,
|
|
96
|
-
THandlerRequirements,
|
|
97
|
-
TServices,
|
|
98
|
-
TServiceError,
|
|
99
|
-
TServiceRequirements,
|
|
100
|
-
TRouteError,
|
|
101
|
-
TRouteRequirements
|
|
102
|
-
> &
|
|
103
|
-
HostPolicy & {
|
|
104
|
-
readonly migrations: MigrationOptions<TMigrations, TMigrationError>;
|
|
105
|
-
},
|
|
106
|
-
database: ReturnType<typeof appDatabase<TMigrations, TMigrationError>>,
|
|
107
|
-
) {
|
|
108
|
-
const services = Layer.mergeAll(options.services ?? Layer.empty);
|
|
109
|
-
return appHostHttp({ ...options, services: services.pipe(Layer.provideMerge(database)) });
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export function deferredHost<
|
|
113
|
-
TRpcs extends Rpc.Any,
|
|
114
|
-
THandlers,
|
|
115
|
-
THandlerError,
|
|
116
|
-
THandlerRequirements,
|
|
117
|
-
TServices,
|
|
118
|
-
TServiceError,
|
|
119
|
-
TServiceRequirements,
|
|
120
|
-
TMigrations,
|
|
121
|
-
TApplicationError,
|
|
122
|
-
TApplicationRequirements,
|
|
123
|
-
TRouteError = never,
|
|
124
|
-
TRouteRequirements = HostRouteRequirements,
|
|
125
|
-
TMigrationError = never,
|
|
126
|
-
>(
|
|
127
|
-
application: Effect.Effect<
|
|
128
|
-
AppHttpHostOptions<
|
|
129
|
-
TRpcs,
|
|
130
|
-
THandlers,
|
|
131
|
-
THandlerError,
|
|
132
|
-
THandlerRequirements,
|
|
133
|
-
TServices,
|
|
134
|
-
TServiceError,
|
|
135
|
-
TServiceRequirements,
|
|
136
|
-
never,
|
|
137
|
-
never,
|
|
138
|
-
never,
|
|
139
|
-
TRouteError,
|
|
140
|
-
TRouteRequirements
|
|
141
|
-
>,
|
|
142
|
-
TApplicationError,
|
|
143
|
-
TApplicationRequirements
|
|
144
|
-
>,
|
|
145
|
-
database: ReturnType<typeof appDatabase<TMigrations, TMigrationError>>,
|
|
146
|
-
) {
|
|
147
|
-
return Layer.unwrap(Effect.map(application, (options) => appHostHttp(options))).pipe(Layer.provideMerge(database));
|
|
148
|
-
}
|
package/src/hostOptions.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type { HttpRouter } from "effect/http";
|
|
|
3
3
|
import type { Rpc, RpcGroup } from "effect/rpc";
|
|
4
4
|
import type { SessionPolicy } from "@shivaedev/identity/server/SessionPolicy.ts";
|
|
5
5
|
import type { AssetOptions } from "#AssetOptions.ts";
|
|
6
|
-
import type { AppDatabaseOptions } from "#appHost.ts";
|
|
7
6
|
import type { BrowserErrorOptions } from "#browserErrorRoute.ts";
|
|
8
7
|
|
|
9
8
|
export type HostRouteRequirements = HttpRouter.HttpRouter | HttpRouter.Request<"Error", unknown>;
|
|
@@ -11,7 +10,7 @@ export type HostRouteRequirements = HttpRouter.HttpRouter | HttpRouter.Request<"
|
|
|
11
10
|
export type HostCoreOptions<TRpcs extends Rpc.Any, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements> = {
|
|
12
11
|
readonly assets?: string | AssetOptions;
|
|
13
12
|
readonly browserErrors?: BrowserErrorOptions;
|
|
14
|
-
readonly config?:
|
|
13
|
+
readonly config?: {
|
|
15
14
|
readonly buildVersion?: string;
|
|
16
15
|
readonly port?: number;
|
|
17
16
|
readonly socketPath?: string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Crypto, Effect, Layer } from "effect";
|
|
2
|
+
import { redactingDiagnostics } from "#redactingDiagnostics.ts";
|
|
3
|
+
|
|
4
|
+
export type HostPreflight<TServices = never, TError = never, TRequirements = never> =
|
|
5
|
+
| { readonly preflight: Layer.Layer<TServices, TError, TRequirements> }
|
|
6
|
+
| ([TServices | TError | TRequirements] extends [never] ? { readonly preflight?: never } : never);
|
|
7
|
+
|
|
8
|
+
export type PreflightHost<THost extends Layer.Any, TServices, TError, TRequirements> = Layer.Layer<
|
|
9
|
+
Layer.Success<THost> | TServices,
|
|
10
|
+
Layer.Error<THost> | TError,
|
|
11
|
+
Exclude<Layer.Services<THost>, TServices | Crypto.Crypto> | Exclude<TRequirements, Crypto.Crypto>
|
|
12
|
+
>;
|
|
13
|
+
|
|
14
|
+
export function hostPreflight<TServices, TError, TRequirements, TSensitiveError>(
|
|
15
|
+
startup: Layer.Layer<TServices, TError, TRequirements> | undefined,
|
|
16
|
+
sensitive: Effect.Effect<(key: string) => boolean, TSensitiveError>,
|
|
17
|
+
) {
|
|
18
|
+
return Layer.mergeAll(
|
|
19
|
+
Layer.empty,
|
|
20
|
+
...(startup === undefined ? [] : [Layer.unwrap(Effect.map(sensitive, (policy) => startup.pipe(Layer.provide(redactingDiagnostics(policy)))))]),
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Duration, Effect, Fiber, Schedule } from "effect";
|
|
2
|
+
import { Migrator } from "effect/sql";
|
|
3
|
+
import { assertPostgresMigrations, postgresMigrationError } from "@shivaedev/sql/assertPostgresMigrations.ts";
|
|
4
|
+
import { migratePostgres } from "@shivaedev/sql/migrations.ts";
|
|
5
|
+
import { type PendingPostgresMigrations, pendingPostgresMigrations } from "@shivaedev/sql/pendingPostgresMigrations.ts";
|
|
6
|
+
import type { MigrationOptions } from "#MigrationOptions.ts";
|
|
7
|
+
|
|
8
|
+
export function prepareMigrations<R, E>(migrations: MigrationOptions<R, E>) {
|
|
9
|
+
switch (migrations.mode) {
|
|
10
|
+
case "check": {
|
|
11
|
+
const { release: _release, ...schema } = migrations;
|
|
12
|
+
return assertPostgresMigrations(schema);
|
|
13
|
+
}
|
|
14
|
+
case "wait":
|
|
15
|
+
return waitForMigrations(migrations);
|
|
16
|
+
default:
|
|
17
|
+
return migratePostgres({ ...migrations, lockTimeout: migrations.lockTimeout ?? "5 seconds" }).pipe(Effect.asVoid);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function waitForMigrations<R, E>(migrations: MigrationOptions<R, E>) {
|
|
22
|
+
return Effect.gen(function* () {
|
|
23
|
+
const progressInterval = Duration.fromInputUnsafe(migrations.progressInterval ?? "30 seconds");
|
|
24
|
+
let pending: PendingPostgresMigrations = { components: [], migrations: [] };
|
|
25
|
+
let progress: Fiber.Fiber<never> | undefined;
|
|
26
|
+
function log(message: string) {
|
|
27
|
+
return Effect.suspend(() =>
|
|
28
|
+
Effect.logInfo(message).pipe(Effect.annotateLogs({ pendingComponents: pending.components, pendingMigrations: pending.migrations })),
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
yield* Effect.gen(function* () {
|
|
32
|
+
pending = yield* pendingPostgresMigrations(migrations);
|
|
33
|
+
if (pending.migrations.length === 0 && pending.components.length === 0) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (progress === undefined) {
|
|
37
|
+
yield* log("Waiting for database migrations");
|
|
38
|
+
progress = yield* Effect.forever(Effect.sleep(progressInterval).pipe(Effect.andThen(log("Still waiting for database migrations")))).pipe(
|
|
39
|
+
Effect.forkScoped,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
return yield* Effect.fail(postgresMigrationError(pending));
|
|
43
|
+
}).pipe(
|
|
44
|
+
Effect.retry({
|
|
45
|
+
schedule: Schedule.max([Schedule.spaced(migrations.pollInterval ?? "1 second"), Schedule.during(migrations.waitTimeout ?? "5 minutes")]),
|
|
46
|
+
while: (error) => error instanceof Migrator.MigrationError && error.kind === "BadState",
|
|
47
|
+
}),
|
|
48
|
+
Effect.tapError((error) =>
|
|
49
|
+
error instanceof Migrator.MigrationError && error.kind === "BadState" ? log("Timed out waiting for database migrations") : Effect.void,
|
|
50
|
+
),
|
|
51
|
+
);
|
|
52
|
+
if (progress !== undefined) {
|
|
53
|
+
yield* Fiber.interrupt(progress);
|
|
54
|
+
yield* Effect.logInfo("Database migrations current");
|
|
55
|
+
}
|
|
56
|
+
}).pipe(Effect.scoped);
|
|
57
|
+
}
|
package/src/workerHost.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as NodeCrypto from "@effect/platform-node/NodeCrypto";
|
|
2
2
|
import { Layer } from "effect";
|
|
3
|
-
import { appDatabase } from "#appDatabase.ts";
|
|
4
|
-
import type { AppDatabaseOptions } from "#appHost.ts";
|
|
3
|
+
import { type AppDatabaseOptions, appDatabase } from "#appDatabase.ts";
|
|
5
4
|
|
|
6
5
|
export function workerHost<R, E, TRequirements, TServices, TServiceError, TServiceRequirements, TMigrations = never, TMigrationError = never>(
|
|
7
6
|
options: AppDatabaseOptions<TMigrations, TMigrationError> & {
|