@effect/sql-mssql 4.0.0-beta.9 → 4.0.0-beta.91
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/MssqlClient.d.ts +57 -16
- package/dist/MssqlClient.d.ts.map +1 -1
- package/dist/MssqlClient.js +154 -39
- package/dist/MssqlClient.js.map +1 -1
- package/dist/MssqlMigrator.d.ts +17 -5
- package/dist/MssqlMigrator.d.ts.map +1 -1
- package/dist/MssqlMigrator.js +8 -4
- package/dist/MssqlMigrator.js.map +1 -1
- package/dist/Parameter.d.ts +16 -8
- package/dist/Parameter.d.ts.map +1 -1
- package/dist/Parameter.js +19 -5
- package/dist/Parameter.js.map +1 -1
- package/dist/Procedure.d.ts +47 -22
- package/dist/Procedure.d.ts.map +1 -1
- package/dist/Procedure.js +33 -13
- package/dist/Procedure.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +6 -6
- package/package.json +4 -4
- package/src/MssqlClient.ts +229 -38
- package/src/MssqlMigrator.ts +17 -5
- package/src/Parameter.ts +27 -9
- package/src/Procedure.ts +57 -24
- package/src/index.ts +6 -6
package/dist/MssqlMigrator.js
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import * as Layer from "effect/Layer";
|
|
2
2
|
import * as Migrator from "effect/unstable/sql/Migrator";
|
|
3
3
|
/**
|
|
4
|
-
* @since
|
|
4
|
+
* @since 4.0.0
|
|
5
5
|
*/
|
|
6
6
|
export * from "effect/unstable/sql/Migrator";
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Runs SQL migrations using the configured `SqlClient`, returning the migrations that were applied.
|
|
9
|
+
*
|
|
10
|
+
* @category constructors
|
|
11
|
+
* @since 4.0.0
|
|
10
12
|
*/
|
|
11
13
|
export const run = /*#__PURE__*/Migrator.make({});
|
|
12
14
|
/**
|
|
15
|
+
* Creates a layer that runs the configured SQL migrations during layer construction.
|
|
16
|
+
*
|
|
13
17
|
* @category layers
|
|
14
|
-
* @since
|
|
18
|
+
* @since 4.0.0
|
|
15
19
|
*/
|
|
16
20
|
export const layer = options => Layer.effectDiscard(run(options));
|
|
17
21
|
//# sourceMappingURL=MssqlMigrator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MssqlMigrator.js","names":["Layer","Migrator","run","make","layer","options","effectDiscard"],"sources":["../src/MssqlMigrator.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"file":"MssqlMigrator.js","names":["Layer","Migrator","run","make","layer","options","effectDiscard"],"sources":["../src/MssqlMigrator.ts"],"sourcesContent":[null],"mappings":"AAYA,OAAO,KAAKA,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,QAAQ,MAAM,8BAA8B;AAIxD;;;AAGA,cAAc,8BAA8B;AAE5C;;;;;;AAMA,OAAO,MAAMC,GAAG,gBAMZD,QAAQ,CAACE,IAAI,CAAC,EAAE,CAAC;AAErB;;;;;;AAMA,OAAO,MAAMC,KAAK,GAChBC,OAAoC,IAC6CL,KAAK,CAACM,aAAa,CAACJ,GAAG,CAACG,OAAO,CAAC,CAAC","ignoreList":[]}
|
package/dist/Parameter.d.ts
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import type { DataType } from "tedious/lib/data-type.ts";
|
|
2
2
|
import type { ParameterOptions } from "tedious/lib/request.ts";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Runtime type identifier used to mark SQL Server stored procedure parameter metadata.
|
|
5
|
+
*
|
|
6
|
+
* @category type IDs
|
|
7
|
+
* @since 4.0.0
|
|
6
8
|
*/
|
|
7
9
|
export declare const TypeId: TypeId;
|
|
8
10
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
+
* Type-level identifier used to mark SQL Server stored procedure parameter metadata.
|
|
12
|
+
*
|
|
13
|
+
* @category type IDs
|
|
14
|
+
* @since 4.0.0
|
|
11
15
|
*/
|
|
12
16
|
export type TypeId = "~@effect/sql-mssql/Parameter";
|
|
13
17
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
18
|
+
* Metadata for a SQL Server stored procedure parameter, including its name, Tedious data type, options, and phantom value type.
|
|
19
|
+
*
|
|
20
|
+
* @category models
|
|
21
|
+
* @since 4.0.0
|
|
16
22
|
*/
|
|
17
23
|
export interface Parameter<out A> {
|
|
18
24
|
readonly [TypeId]: (_: never) => A;
|
|
@@ -22,8 +28,10 @@ export interface Parameter<out A> {
|
|
|
22
28
|
readonly options: ParameterOptions;
|
|
23
29
|
}
|
|
24
30
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
31
|
+
* Creates typed metadata for a SQL Server stored procedure parameter.
|
|
32
|
+
*
|
|
33
|
+
* @category constructors
|
|
34
|
+
* @since 4.0.0
|
|
27
35
|
*/
|
|
28
36
|
export declare const make: <A>(name: string, type: DataType, options?: ParameterOptions) => Parameter<A>;
|
|
29
37
|
//# sourceMappingURL=Parameter.d.ts.map
|
package/dist/Parameter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Parameter.d.ts","sourceRoot":"","sources":["../src/Parameter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Parameter.d.ts","sourceRoot":"","sources":["../src/Parameter.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,MAAM,EAAE,MAAuC,CAAA;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,MAAM,GAAG,8BAA8B,CAAA;AAEnD;;;;;GAKG;AACH,MAAM,WAAW,SAAS,CAAC,GAAG,CAAC,CAAC;IAC9B,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,CAAA;IAClC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;IACvB,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAA;CACnC;AAED;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,EACpB,MAAM,MAAM,EACZ,MAAM,QAAQ,EACd,UAAS,gBAAqB,KAC7B,SAAS,CAAC,CAAC,CAMZ,CAAA"}
|
package/dist/Parameter.js
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Typed SQL Server stored procedure parameter metadata.
|
|
3
|
+
*
|
|
4
|
+
* This module builds {@link Parameter} values that pair a stored procedure
|
|
5
|
+
* parameter name with a Tedious `DataType`, Tedious `ParameterOptions`, and a
|
|
6
|
+
* phantom TypeScript value type. `Procedure.param` and
|
|
7
|
+
* `Procedure.outputParam` use this metadata, and `MssqlClient.call` forwards it
|
|
8
|
+
* to Tedious when registering input and output parameters.
|
|
9
|
+
*
|
|
10
|
+
* @see {@link make} for constructing parameter metadata directly.
|
|
11
|
+
*
|
|
12
|
+
* @since 4.0.0
|
|
3
13
|
*/
|
|
4
14
|
import { identity } from "effect/Function";
|
|
5
15
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
16
|
+
* Runtime type identifier used to mark SQL Server stored procedure parameter metadata.
|
|
17
|
+
*
|
|
18
|
+
* @category type IDs
|
|
19
|
+
* @since 4.0.0
|
|
8
20
|
*/
|
|
9
21
|
export const TypeId = "~@effect/sql-mssql/Parameter";
|
|
10
22
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
23
|
+
* Creates typed metadata for a SQL Server stored procedure parameter.
|
|
24
|
+
*
|
|
25
|
+
* @category constructors
|
|
26
|
+
* @since 4.0.0
|
|
13
27
|
*/
|
|
14
28
|
export const make = (name, type, options = {}) => ({
|
|
15
29
|
[TypeId]: identity,
|
package/dist/Parameter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Parameter.js","names":["identity","TypeId","make","name","type","options","_tag"],"sources":["../src/Parameter.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Parameter.js","names":["identity","TypeId","make","name","type","options","_tag"],"sources":["../src/Parameter.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;AAaA,SAASA,QAAQ,QAAQ,iBAAiB;AAI1C;;;;;;AAMA,OAAO,MAAMC,MAAM,GAAW,8BAA8B;AAwB5D;;;;;;AAMA,OAAO,MAAMC,IAAI,GAAGA,CAClBC,IAAY,EACZC,IAAc,EACdC,OAAA,GAA4B,EAAE,MACZ;EAClB,CAACJ,MAAM,GAAGD,QAAQ;EAClBM,IAAI,EAAE,WAAW;EACjBH,IAAI;EACJC,IAAI;EACJC;CACD,CAAC","ignoreList":[]}
|
package/dist/Procedure.d.ts
CHANGED
|
@@ -5,18 +5,24 @@ import type { DataType } from "tedious/lib/data-type.ts";
|
|
|
5
5
|
import type { ParameterOptions } from "tedious/lib/request.ts";
|
|
6
6
|
import * as Parameter from "./Parameter.ts";
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Runtime type identifier used to mark SQL Server stored procedure definitions.
|
|
9
|
+
*
|
|
10
|
+
* @category type IDs
|
|
11
|
+
* @since 4.0.0
|
|
10
12
|
*/
|
|
11
13
|
export declare const TypeId: TypeId;
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
+
* Type-level identifier used to mark SQL Server stored procedure definitions.
|
|
16
|
+
*
|
|
17
|
+
* @category type IDs
|
|
18
|
+
* @since 4.0.0
|
|
15
19
|
*/
|
|
16
20
|
export type TypeId = "~@effect/sql-mssql/Procedure";
|
|
17
21
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
22
|
+
* Pipeable definition of a SQL Server stored procedure, tracking its input parameters, output parameters, and result row type.
|
|
23
|
+
*
|
|
24
|
+
* @category models
|
|
25
|
+
* @since 4.0.0
|
|
20
26
|
*/
|
|
21
27
|
export interface Procedure<I extends Record<string, Parameter.Parameter<any>>, O extends Record<string, Parameter.Parameter<any>>, A = never> extends Pipeable {
|
|
22
28
|
readonly [TypeId]: {
|
|
@@ -28,25 +34,34 @@ export interface Procedure<I extends Record<string, Parameter.Parameter<any>>, O
|
|
|
28
34
|
readonly outputParams: O;
|
|
29
35
|
}
|
|
30
36
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
37
|
+
* Stored procedure definition with concrete input values bound for execution.
|
|
38
|
+
*
|
|
39
|
+
* @category models
|
|
40
|
+
* @since 4.0.0
|
|
33
41
|
*/
|
|
34
42
|
export interface ProcedureWithValues<I extends Record<string, Parameter.Parameter<any>>, O extends Record<string, Parameter.Parameter<any>>, A> extends Procedure<I, O, A> {
|
|
35
43
|
readonly values: Procedure.ParametersRecord<I>;
|
|
36
44
|
}
|
|
37
45
|
/**
|
|
38
|
-
*
|
|
46
|
+
* Namespace containing type helpers and result types for SQL Server stored procedures.
|
|
47
|
+
*
|
|
48
|
+
* @since 4.0.0
|
|
39
49
|
*/
|
|
40
50
|
export declare namespace Procedure {
|
|
41
51
|
/**
|
|
42
|
-
*
|
|
52
|
+
* Maps a record of `Parameter` metadata to the corresponding record of parameter value types.
|
|
53
|
+
*
|
|
54
|
+
* @category utility types
|
|
55
|
+
* @since 4.0.0
|
|
43
56
|
*/
|
|
44
57
|
type ParametersRecord<A extends Record<string, Parameter.Parameter<any>>> = {
|
|
45
58
|
readonly [K in keyof A]: A[K] extends Parameter.Parameter<infer T> ? T : never;
|
|
46
59
|
} & {};
|
|
47
60
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
61
|
+
* Result of a SQL Server stored procedure call, containing typed output parameter values and returned rows.
|
|
62
|
+
*
|
|
63
|
+
* @category models
|
|
64
|
+
* @since 4.0.0
|
|
50
65
|
*/
|
|
51
66
|
interface Result<O extends Record<string, Parameter.Parameter<any>>, A> {
|
|
52
67
|
readonly output: ParametersRecord<O>;
|
|
@@ -57,28 +72,38 @@ type Simplify<A> = {
|
|
|
57
72
|
[K in keyof A]: A[K];
|
|
58
73
|
} & {};
|
|
59
74
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
75
|
+
* Creates an empty SQL Server stored procedure definition for the given procedure name.
|
|
76
|
+
*
|
|
77
|
+
* @category constructors
|
|
78
|
+
* @since 4.0.0
|
|
62
79
|
*/
|
|
63
80
|
export declare const make: (name: string) => Procedure<{}, {}>;
|
|
64
81
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
82
|
+
* Adds a typed input parameter to a SQL Server stored procedure definition.
|
|
83
|
+
*
|
|
84
|
+
* @category combinators
|
|
85
|
+
* @since 4.0.0
|
|
67
86
|
*/
|
|
68
87
|
export declare const param: <A>() => <N extends string, T extends DataType>(name: N, type: T, options?: ParameterOptions) => <I extends Record<string, Parameter.Parameter<any>>, O extends Record<string, Parameter.Parameter<any>>>(self: Procedure<I, O>) => Procedure<Simplify<I & { [K in N]: Parameter.Parameter<A>; }>, O>;
|
|
69
88
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
89
|
+
* Adds a typed output parameter to a SQL Server stored procedure definition.
|
|
90
|
+
*
|
|
91
|
+
* @category combinators
|
|
92
|
+
* @since 4.0.0
|
|
72
93
|
*/
|
|
73
94
|
export declare const outputParam: <A>() => <N extends string, T extends DataType>(name: N, type: T, options?: ParameterOptions) => <I extends Record<string, Parameter.Parameter<any>>, O extends Record<string, Parameter.Parameter<any>>>(self: Procedure<I, O>) => Procedure<I, Simplify<O & { [K in N]: Parameter.Parameter<A>; }>>;
|
|
74
95
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
96
|
+
* Sets the expected row type for a SQL Server stored procedure definition.
|
|
97
|
+
*
|
|
98
|
+
* @category combinators
|
|
99
|
+
* @since 4.0.0
|
|
77
100
|
*/
|
|
78
101
|
export declare const withRows: <A extends object = Row>() => <I extends Record<string, Parameter.Parameter<any>>, O extends Record<string, Parameter.Parameter<any>>>(self: Procedure<I, O>) => Procedure<I, O, A>;
|
|
79
102
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
103
|
+
* Binds input values to a SQL Server stored procedure definition, producing a value that can be executed with `MssqlClient.call`.
|
|
104
|
+
*
|
|
105
|
+
* @category combinators
|
|
106
|
+
* @since 4.0.0
|
|
82
107
|
*/
|
|
83
108
|
export declare const compile: <I extends Record<string, Parameter.Parameter<any>>, O extends Record<string, Parameter.Parameter<any>>, A>(self: Procedure<I, O, A>) => (input: Procedure.ParametersRecord<I>) => ProcedureWithValues<I, O, A>;
|
|
84
109
|
export {};
|
package/dist/Procedure.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Procedure.d.ts","sourceRoot":"","sources":["../src/Procedure.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Procedure.d.ts","sourceRoot":"","sources":["../src/Procedure.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mCAAmC,CAAA;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;;;;GAKG;AACH,eAAO,MAAM,MAAM,EAAE,MAAuC,CAAA;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,MAAM,GAAG,8BAA8B,CAAA;AAEnD;;;;;GAKG;AACH,MAAM,WAAW,SAAS,CACxB,CAAC,SAAS,MAAM,CAAC,MAAM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AAM,CAAC,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAElD,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KACpB,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,GAAE,CAAC,CAMhE,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,GAAG,GAAG,QAE7C,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAClD,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAElD,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KACpB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAgB,CAAA;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAClB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAClD,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAClD,CAAC,EAED,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,MAEzB,OAAO,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAG,mBAAmB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAGjE,CAAA"}
|
package/dist/Procedure.js
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Typed metadata builders for Microsoft SQL Server stored procedure calls.
|
|
3
|
+
*
|
|
4
|
+
* This module defines the `Procedure` values consumed by `MssqlClient.call`.
|
|
5
|
+
* `make` starts a procedure definition, `param` and `outputParam` add typed
|
|
6
|
+
* Tedious parameter metadata, `withRows` sets the expected row type, and
|
|
7
|
+
* `compile` binds input values before execution. The module also defines the
|
|
8
|
+
* typed result shape for output parameters and returned rows.
|
|
9
|
+
*
|
|
10
|
+
* @since 4.0.0
|
|
3
11
|
*/
|
|
4
12
|
import { identity } from "effect/Function";
|
|
5
13
|
import { pipeArguments } from "effect/Pipeable";
|
|
6
14
|
import * as Parameter from "./Parameter.js";
|
|
7
15
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
16
|
+
* Runtime type identifier used to mark SQL Server stored procedure definitions.
|
|
17
|
+
*
|
|
18
|
+
* @category type IDs
|
|
19
|
+
* @since 4.0.0
|
|
10
20
|
*/
|
|
11
21
|
export const TypeId = "~@effect/sql-mssql/Procedure";
|
|
12
22
|
const procedureProto = {
|
|
@@ -19,8 +29,10 @@ const procedureProto = {
|
|
|
19
29
|
}
|
|
20
30
|
};
|
|
21
31
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
32
|
+
* Creates an empty SQL Server stored procedure definition for the given procedure name.
|
|
33
|
+
*
|
|
34
|
+
* @category constructors
|
|
35
|
+
* @since 4.0.0
|
|
24
36
|
*/
|
|
25
37
|
export const make = name => {
|
|
26
38
|
const procedure = Object.create(procedureProto);
|
|
@@ -30,8 +42,10 @@ export const make = name => {
|
|
|
30
42
|
return procedure;
|
|
31
43
|
};
|
|
32
44
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
45
|
+
* Adds a typed input parameter to a SQL Server stored procedure definition.
|
|
46
|
+
*
|
|
47
|
+
* @category combinators
|
|
48
|
+
* @since 4.0.0
|
|
35
49
|
*/
|
|
36
50
|
export const param = () => (name, type, options) => self => ({
|
|
37
51
|
...self,
|
|
@@ -41,8 +55,10 @@ export const param = () => (name, type, options) => self => ({
|
|
|
41
55
|
}
|
|
42
56
|
});
|
|
43
57
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
58
|
+
* Adds a typed output parameter to a SQL Server stored procedure definition.
|
|
59
|
+
*
|
|
60
|
+
* @category combinators
|
|
61
|
+
* @since 4.0.0
|
|
46
62
|
*/
|
|
47
63
|
export const outputParam = () => (name, type, options) => self => ({
|
|
48
64
|
...self,
|
|
@@ -52,13 +68,17 @@ export const outputParam = () => (name, type, options) => self => ({
|
|
|
52
68
|
}
|
|
53
69
|
});
|
|
54
70
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
71
|
+
* Sets the expected row type for a SQL Server stored procedure definition.
|
|
72
|
+
*
|
|
73
|
+
* @category combinators
|
|
74
|
+
* @since 4.0.0
|
|
57
75
|
*/
|
|
58
76
|
export const withRows = () => self => self;
|
|
59
77
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
78
|
+
* Binds input values to a SQL Server stored procedure definition, producing a value that can be executed with `MssqlClient.call`.
|
|
79
|
+
*
|
|
80
|
+
* @category combinators
|
|
81
|
+
* @since 4.0.0
|
|
62
82
|
*/
|
|
63
83
|
export const compile = self => input => ({
|
|
64
84
|
...self,
|
package/dist/Procedure.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Procedure.js","names":["identity","pipeArguments","Parameter","TypeId","procedureProto","_A","_tag","pipe","arguments","make","name","procedure","Object","create","params","outputParams","param","type","options","self","outputParam","withRows","compile","input","values"],"sources":["../src/Procedure.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Procedure.js","names":["identity","pipeArguments","Parameter","TypeId","procedureProto","_A","_tag","pipe","arguments","make","name","procedure","Object","create","params","outputParams","param","type","options","self","outputParam","withRows","compile","input","values"],"sources":["../src/Procedure.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;AAWA,SAASA,QAAQ,QAAQ,iBAAiB;AAE1C,SAASC,aAAa,QAAQ,iBAAiB;AAK/C,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAE3C;;;;;;AAMA,OAAO,MAAMC,MAAM,GAAW,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
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @since
|
|
2
|
+
* @since 4.0.0
|
|
3
3
|
*/
|
|
4
4
|
export {
|
|
5
5
|
/**
|
|
6
|
-
* @since
|
|
6
|
+
* @since 4.0.0
|
|
7
7
|
*/
|
|
8
8
|
TYPES as MssqlTypes } from "tedious";
|
|
9
9
|
/**
|
|
10
|
-
* @since
|
|
10
|
+
* @since 4.0.0
|
|
11
11
|
*/
|
|
12
12
|
export * as MssqlClient from "./MssqlClient.ts";
|
|
13
13
|
/**
|
|
14
|
-
* @since
|
|
14
|
+
* @since 4.0.0
|
|
15
15
|
*/
|
|
16
16
|
export * as MssqlMigrator from "./MssqlMigrator.ts";
|
|
17
17
|
/**
|
|
18
|
-
* @since
|
|
18
|
+
* @since 4.0.0
|
|
19
19
|
*/
|
|
20
20
|
export * as Parameter from "./Parameter.ts";
|
|
21
21
|
/**
|
|
22
|
-
* @since
|
|
22
|
+
* @since 4.0.0
|
|
23
23
|
*/
|
|
24
24
|
export * as Procedure from "./Procedure.ts";
|
|
25
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @since
|
|
2
|
+
* @since 4.0.0
|
|
3
3
|
*/
|
|
4
4
|
export {
|
|
5
5
|
/**
|
|
6
|
-
* @since
|
|
6
|
+
* @since 4.0.0
|
|
7
7
|
*/
|
|
8
8
|
TYPES as MssqlTypes } from "tedious";
|
|
9
9
|
// @barrel: Auto-generated exports. Do not edit manually.
|
|
10
10
|
/**
|
|
11
|
-
* @since
|
|
11
|
+
* @since 4.0.0
|
|
12
12
|
*/
|
|
13
13
|
export * as MssqlClient from "./MssqlClient.js";
|
|
14
14
|
/**
|
|
15
|
-
* @since
|
|
15
|
+
* @since 4.0.0
|
|
16
16
|
*/
|
|
17
17
|
export * as MssqlMigrator from "./MssqlMigrator.js";
|
|
18
18
|
/**
|
|
19
|
-
* @since
|
|
19
|
+
* @since 4.0.0
|
|
20
20
|
*/
|
|
21
21
|
export * as Parameter from "./Parameter.js";
|
|
22
22
|
/**
|
|
23
|
-
* @since
|
|
23
|
+
* @since 4.0.0
|
|
24
24
|
*/
|
|
25
25
|
export * as Procedure from "./Procedure.js";
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/sql-mssql",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.91",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A Microsoft SQL Server toolkit for Effect",
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"provenance": true
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"effect": "^4.0.0-beta.
|
|
46
|
+
"effect": "^4.0.0-beta.91"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"effect": "^4.0.0-beta.
|
|
49
|
+
"effect": "^4.0.0-beta.91"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"tedious": "^19.2.
|
|
52
|
+
"tedious": "^19.2.1"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"codegen": "effect-utils codegen",
|