@riordanpawley/effect-prisma-generator 0.6.2 → 0.6.4
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/dist/index.js +6 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -989,6 +989,7 @@ export class Prisma extends Context.Tag("Prisma")<Prisma, IPrismaService>() {
|
|
|
989
989
|
* Used internally by layer constructors.
|
|
990
990
|
*/
|
|
991
991
|
static make: Effect.Effect<IPrismaService, never, PrismaClient> = makePrismaService;
|
|
992
|
+
static Default = Layer.effect(Prisma, this.make);
|
|
992
993
|
|
|
993
994
|
/**
|
|
994
995
|
* Create a complete Prisma layer with the given PrismaClient options.
|
|
@@ -1017,8 +1018,8 @@ export class Prisma extends Context.Tag("Prisma")<Prisma, IPrismaService>() {
|
|
|
1017
1018
|
*/
|
|
1018
1019
|
static layer = (
|
|
1019
1020
|
...args: ConstructorParameters<typeof BasePrismaClient>
|
|
1020
|
-
) =>
|
|
1021
|
-
Layer.
|
|
1021
|
+
) => this.Default.pipe(
|
|
1022
|
+
Layer.provideMerge(PrismaClient.layer(...args))
|
|
1022
1023
|
);
|
|
1023
1024
|
|
|
1024
1025
|
/**
|
|
@@ -1046,8 +1047,8 @@ export class Prisma extends Context.Tag("Prisma")<Prisma, IPrismaService>() {
|
|
|
1046
1047
|
*/
|
|
1047
1048
|
static layerEffect = <R, E>(
|
|
1048
1049
|
optionsEffect: Effect.Effect<ConstructorParameters<typeof BasePrismaClient>[0], E, R>
|
|
1049
|
-
) =>
|
|
1050
|
-
Layer.
|
|
1050
|
+
) => this.Default.pipe(
|
|
1051
|
+
Layer.provideMerge(PrismaClient.layerEffect(optionsEffect))
|
|
1051
1052
|
);
|
|
1052
1053
|
}
|
|
1053
1054
|
|
|
@@ -1654,7 +1655,7 @@ const makePrismaService = Effect.gen(function* () {
|
|
|
1654
1655
|
|
|
1655
1656
|
// If already in a transaction, just run the effect
|
|
1656
1657
|
if (Option.isSome(currentTx)) {
|
|
1657
|
-
return yield* (effect as
|
|
1658
|
+
return yield* (effect as Effect.Effect<
|
|
1658
1659
|
Effect.Effect.Success<typeof effect>,
|
|
1659
1660
|
Effect.Effect.Error<typeof effect>,
|
|
1660
1661
|
Exclude<
|