@effect/sql-mssql 4.0.0-beta.7 → 4.0.0-beta.70

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.
@@ -1 +1 @@
1
- {"version":3,"file":"MssqlMigrator.js","names":["Layer","Migrator","run","make","layer","options","effectDiscard"],"sources":["../src/MssqlMigrator.ts"],"sourcesContent":[null],"mappings":"AAIA,OAAO,KAAKA,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,QAAQ,MAAM,8BAA8B;AAIxD;;;AAGA,cAAc,8BAA8B;AAE5C;;;;AAIA,OAAO,MAAMC,GAAG,gBAMZD,QAAQ,CAACE,IAAI,CAAC,EAAE,CAAC;AAErB;;;;AAIA,OAAO,MAAMC,KAAK,GAChBC,OAAoC,IAC6CL,KAAK,CAACM,aAAa,CAACJ,GAAG,CAACG,OAAO,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"MssqlMigrator.js","names":["Layer","Migrator","run","make","layer","options","effectDiscard"],"sources":["../src/MssqlMigrator.ts"],"sourcesContent":[null],"mappings":"AAyBA,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":[]}
@@ -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
+ * Runtime type identifier used to mark SQL Server stored procedure parameter metadata.
5
+ *
4
6
  * @category type id
5
- * @since 1.0.0
7
+ * @since 4.0.0
6
8
  */
7
9
  export declare const TypeId: TypeId;
8
10
  /**
11
+ * Type-level identifier used to mark SQL Server stored procedure parameter metadata.
12
+ *
9
13
  * @category type id
10
- * @since 1.0.0
14
+ * @since 4.0.0
11
15
  */
12
16
  export type TypeId = "~@effect/sql-mssql/Parameter";
13
17
  /**
14
- * @category model
15
- * @since 1.0.0
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
- * @category constructor
26
- * @since 1.0.0
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
@@ -1 +1 @@
1
- {"version":3,"file":"Parameter.d.ts","sourceRoot":"","sources":["../src/Parameter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,MAAuC,CAAA;AAE5D;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,8BAA8B,CAAA;AAEnD;;;GAGG;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;;;GAGG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,EACpB,MAAM,MAAM,EACZ,MAAM,QAAQ,EACd,UAAS,gBAAqB,KAC7B,SAAS,CAAC,CAAC,CAMZ,CAAA"}
1
+ {"version":3,"file":"Parameter.d.ts","sourceRoot":"","sources":["../src/Parameter.ts"],"names":[],"mappings":"AAwBA,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,39 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Typed metadata for SQL Server stored procedure parameters.
3
+ *
4
+ * This module records the bare parameter name, Tedious `DataType`, Tedious
5
+ * `ParameterOptions`, and phantom TypeScript value type used by
6
+ * `Procedure.param` and `Procedure.outputParam`. `MssqlClient.call` later
7
+ * forwards input parameters to Tedious with `Request.addParameter` and output
8
+ * parameters with `Request.addOutputParameter`, so names should match the
9
+ * stored procedure parameter name without a leading `@`.
10
+ *
11
+ * Use these values when defining stored procedures that need explicit SQL
12
+ * Server parameter metadata, such as sized strings or binary values, decimal
13
+ * precision/scale, table-valued parameters, and output parameters. The generic
14
+ * type parameter is only a compile-time guide for the value record accepted by
15
+ * `Procedure.compile`; Tedious still validates and encodes the runtime value.
16
+ * In particular, TVP values must use Tedious' table shape with `name`,
17
+ * optional `schema`, `columns`, and `rows`, and output parameters are registered
18
+ * with no initial value, so SQL Server input-output parameters need separate
19
+ * care rather than assuming an output parameter is populated from compiled
20
+ * input values.
21
+ *
22
+ * @since 4.0.0
3
23
  */
4
24
  import { identity } from "effect/Function";
5
25
  /**
26
+ * Runtime type identifier used to mark SQL Server stored procedure parameter metadata.
27
+ *
6
28
  * @category type id
7
- * @since 1.0.0
29
+ * @since 4.0.0
8
30
  */
9
31
  export const TypeId = "~@effect/sql-mssql/Parameter";
10
32
  /**
11
- * @category constructor
12
- * @since 1.0.0
33
+ * Creates typed metadata for a SQL Server stored procedure parameter.
34
+ *
35
+ * @category constructors
36
+ * @since 4.0.0
13
37
  */
14
38
  export const make = (name, type, options = {}) => ({
15
39
  [TypeId]: identity,
@@ -1 +1 @@
1
- {"version":3,"file":"Parameter.js","names":["identity","TypeId","make","name","type","options","_tag"],"sources":["../src/Parameter.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,SAASA,QAAQ,QAAQ,iBAAiB;AAI1C;;;;AAIA,OAAO,MAAMC,MAAM,GAAW,8BAA8B;AAoB5D;;;;AAIA,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":[]}
1
+ {"version":3,"file":"Parameter.js","names":["identity","TypeId","make","name","type","options","_tag"],"sources":["../src/Parameter.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;AAuBA,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":[]}
@@ -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
+ * Runtime type identifier used to mark SQL Server stored procedure definitions.
9
+ *
8
10
  * @category type id
9
- * @since 1.0.0
11
+ * @since 4.0.0
10
12
  */
11
13
  export declare const TypeId: TypeId;
12
14
  /**
15
+ * Type-level identifier used to mark SQL Server stored procedure definitions.
16
+ *
13
17
  * @category type id
14
- * @since 1.0.0
18
+ * @since 4.0.0
15
19
  */
16
20
  export type TypeId = "~@effect/sql-mssql/Procedure";
17
21
  /**
18
- * @category model
19
- * @since 1.0.0
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
- * @category model
32
- * @since 1.0.0
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
- * @since 1.0.0
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
- * @since 1.0.0
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
- * @category model
49
- * @since 1.0.0
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
- * @category constructor
61
- * @since 1.0.0
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
  /**
82
+ * Adds a typed input parameter to a SQL Server stored procedure definition.
83
+ *
65
84
  * @category combinator
66
- * @since 1.0.0
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
  /**
89
+ * Adds a typed output parameter to a SQL Server stored procedure definition.
90
+ *
70
91
  * @category combinator
71
- * @since 1.0.0
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
  /**
96
+ * Sets the expected row type for a SQL Server stored procedure definition.
97
+ *
75
98
  * @category combinator
76
- * @since 1.0.0
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
  /**
103
+ * Binds input values to a SQL Server stored procedure definition, producing a value that can be executed with `MssqlClient.call`.
104
+ *
80
105
  * @category combinator
81
- * @since 1.0.0
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 {};
@@ -1 +1 @@
1
- {"version":3,"file":"Procedure.d.ts","sourceRoot":"","sources":["../src/Procedure.ts"],"names":[],"mappings":"AAIA,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;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,MAAuC,CAAA;AAE5D;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,8BAA8B,CAA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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,31 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Typed builders for Microsoft SQL Server stored procedure definitions.
3
+ *
4
+ * This module describes the metadata consumed by `MssqlClient.call`: create a
5
+ * definition with `make`, add input and output parameters with their Tedious
6
+ * data types and `ParameterOptions`, optionally describe the returned row shape
7
+ * with `withRows`, and use `compile` to bind the input values before execution.
8
+ * It is useful when application code calls stored procedures for commands,
9
+ * reports, migrations, or workflows that return both result sets and output
10
+ * parameters.
11
+ *
12
+ * Parameter value types are supplied explicitly through `param<A>()` and
13
+ * `outputParam<A>()`; they are not inferred from the Tedious data type. Input
14
+ * values must be keyed by the parameter names in the definition, output
15
+ * parameters are collected separately from returned rows, and `withRows` only
16
+ * records the expected TypeScript row type, so row names and transforms still
17
+ * follow the configured `MssqlClient` result handling.
18
+ *
19
+ * @since 4.0.0
3
20
  */
4
21
  import { identity } from "effect/Function";
5
22
  import { pipeArguments } from "effect/Pipeable";
6
23
  import * as Parameter from "./Parameter.js";
7
24
  /**
25
+ * Runtime type identifier used to mark SQL Server stored procedure definitions.
26
+ *
8
27
  * @category type id
9
- * @since 1.0.0
28
+ * @since 4.0.0
10
29
  */
11
30
  export const TypeId = "~@effect/sql-mssql/Procedure";
12
31
  const procedureProto = {
@@ -19,8 +38,10 @@ const procedureProto = {
19
38
  }
20
39
  };
21
40
  /**
22
- * @category constructor
23
- * @since 1.0.0
41
+ * Creates an empty SQL Server stored procedure definition for the given procedure name.
42
+ *
43
+ * @category constructors
44
+ * @since 4.0.0
24
45
  */
25
46
  export const make = name => {
26
47
  const procedure = Object.create(procedureProto);
@@ -30,8 +51,10 @@ export const make = name => {
30
51
  return procedure;
31
52
  };
32
53
  /**
54
+ * Adds a typed input parameter to a SQL Server stored procedure definition.
55
+ *
33
56
  * @category combinator
34
- * @since 1.0.0
57
+ * @since 4.0.0
35
58
  */
36
59
  export const param = () => (name, type, options) => self => ({
37
60
  ...self,
@@ -41,8 +64,10 @@ export const param = () => (name, type, options) => self => ({
41
64
  }
42
65
  });
43
66
  /**
67
+ * Adds a typed output parameter to a SQL Server stored procedure definition.
68
+ *
44
69
  * @category combinator
45
- * @since 1.0.0
70
+ * @since 4.0.0
46
71
  */
47
72
  export const outputParam = () => (name, type, options) => self => ({
48
73
  ...self,
@@ -52,13 +77,17 @@ export const outputParam = () => (name, type, options) => self => ({
52
77
  }
53
78
  });
54
79
  /**
80
+ * Sets the expected row type for a SQL Server stored procedure definition.
81
+ *
55
82
  * @category combinator
56
- * @since 1.0.0
83
+ * @since 4.0.0
57
84
  */
58
85
  export const withRows = () => self => self;
59
86
  /**
87
+ * Binds input values to a SQL Server stored procedure definition, producing a value that can be executed with `MssqlClient.call`.
88
+ *
60
89
  * @category combinator
61
- * @since 1.0.0
90
+ * @since 4.0.0
62
91
  */
63
92
  export const compile = self => input => ({
64
93
  ...self,
@@ -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;;;AAGA,SAASA,QAAQ,QAAQ,iBAAiB;AAE1C,SAASC,aAAa,QAAQ,iBAAiB;AAK/C,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAE3C;;;;AAIA,OAAO,MAAMC,MAAM,GAAW,8BAA8B;AAqE5D,MAAMC,cAAc,GAAG;EACrB,CAACD,MAAM,GAAG;IACRE,EAAE,EAAEL;GACL;EACDM,IAAI,EAAE,WAAW;EACjBC,IAAIA,CAAA;IACF,OAAON,aAAa,CAAC,IAAI,EAAEO,SAAS,CAAC;EACvC;CACD;AAED;;;;AAIA,OAAO,MAAMC,IAAI,GAAIC,IAAY,IAAuB;EACtD,MAAMC,SAAS,GAAGC,MAAM,CAACC,MAAM,CAACT,cAAc,CAAC;EAC/CO,SAAS,CAACD,IAAI,GAAGA,IAAI;EACrBC,SAAS,CAACG,MAAM,GAAG,EAAE;EACrBH,SAAS,CAACI,YAAY,GAAG,EAAE;EAC3B,OAAOJ,SAAS;AAClB,CAAC;AAED;;;;AAIA,OAAO,MAAMK,KAAK,GAAGA,CAAA,KACrB,CACEN,IAAO,EACPO,IAAO,EACPC,OAA0B,KAM1BC,IAAqB,KACiD;EACtE,GAAGA,IAAI;EACPL,MAAM,EAAE;IACN,GAAGK,IAAI,CAACL,MAAM;IACd,CAACJ,IAAI,GAAGR,SAAS,CAACO,IAAI,CAACC,IAAI,EAAEO,IAAI,EAAEC,OAAO;;CAE7C,CAAC;AAEF;;;;AAIA,OAAO,MAAME,WAAW,GAAGA,CAAA,KAC3B,CACEV,IAAO,EACPO,IAAO,EACPC,OAA0B,KAM1BC,IAAqB,KACiD;EACtE,GAAGA,IAAI;EACPJ,YAAY,EAAE;IACZ,GAAGI,IAAI,CAACJ,YAAY;IACpB,CAACL,IAAI,GAAGR,SAAS,CAACO,IAAI,CAACC,IAAI,EAAEO,IAAI,EAAEC,OAAO;;CAE7C,CAAC;AAEF;;;;AAIA,OAAO,MAAMG,QAAQ,GAAGA,CAAA,KAKtBF,IAAqB,IACEA,IAAW;AAEpC;;;;AAIA,OAAO,MAAMG,OAAO,GAKlBH,IAAwB,IAEzBI,KAAoC,KAAoC;EACvE,GAAGJ,IAAI;EACPK,MAAM,EAAED;CACT,CAAC","ignoreList":[]}
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/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AAEF;;;;;;AAMA,OAAO,MAAMG,QAAQ,GAAGA,CAAA,KAKtBF,IAAqB,IACEA,IAAW;AAEpC;;;;;;AAMA,OAAO,MAAMG,OAAO,GAKlBH,IAAwB,IAEzBI,KAAoC,KAAoC;EACvE,GAAGJ,IAAI;EACPK,MAAM,EAAED;CACT,CAAC","ignoreList":[]}
package/dist/index.d.ts CHANGED
@@ -1,25 +1,109 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * @since 4.0.0
3
3
  */
4
4
  export {
5
5
  /**
6
- * @since 1.0.0
6
+ * @since 4.0.0
7
7
  */
8
8
  TYPES as MssqlTypes } from "tedious";
9
9
  /**
10
- * @since 1.0.0
10
+ * Microsoft SQL Server client implementation for Effect SQL, backed by the
11
+ * `tedious` driver.
12
+ *
13
+ * This module provides the `MssqlClient` service and layers that also satisfy
14
+ * the generic `SqlClient` service. It is intended for server applications,
15
+ * background workers, migrations, and tests that need SQL Server query
16
+ * compilation, Tedious parameter typing, scoped connection management,
17
+ * transactions, and typed stored procedure calls.
18
+ *
19
+ * Clients own a scoped pool of Tedious connections and validate startup with
20
+ * `SELECT 1`. Regular queries borrow a pooled connection per operation, while
21
+ * transactions keep one pooled connection for their lifetime and use SQL Server
22
+ * savepoints for nested transactions. Long-running transactions therefore
23
+ * reduce available pool capacity; size `maxConnections`, `connectionTTL`, and
24
+ * `connectTimeout` accordingly.
25
+ *
26
+ * Tedious permits one active request per connection. This client compiles
27
+ * statements with named `@1`-style parameters, maps Effect SQL primitive values
28
+ * to Tedious `DataType`s unless `param` is used, and does not implement
29
+ * streaming queries. Be deliberate about TLS options: `encrypt` defaults to
30
+ * `false` and `trustServerCertificate` defaults to `true` unless overridden.
31
+ * Stored procedure calls go through `callProcedure`; define input and output
32
+ * parameters with the `Procedure` and `Parameter` helpers so Tedious receives
33
+ * the correct data types and output values can be collected from `returnValue`
34
+ * events.
35
+ *
36
+ * @since 4.0.0
11
37
  */
12
38
  export * as MssqlClient from "./MssqlClient.ts";
13
39
  /**
14
- * @since 1.0.0
40
+ * Utilities for applying Effect SQL migrations to Microsoft SQL Server.
41
+ *
42
+ * This module re-exports the shared `Migrator` loaders and error types, then
43
+ * provides `run` and `layer` helpers for applying ordered migrations through
44
+ * the current SQL Server `SqlClient`. It is typically used at application
45
+ * startup, during deployment, in integration tests that provision temporary SQL
46
+ * Server databases, or in layer graphs that need the database schema to be
47
+ * current before dependent services are acquired.
48
+ *
49
+ * Applied migrations are stored in `effect_sql_migrations` by default and use
50
+ * the shared `<id>_<name>` loader convention. Only migrations with ids greater
51
+ * than the latest recorded id are run, so avoid inserting older migration ids
52
+ * after a later migration has reached production. SQL Server migrations run
53
+ * inside the shared migrator transaction and this adapter does not add a
54
+ * dialect-specific table lock, so coordinate concurrent startup runners and
55
+ * write T-SQL that is valid inside an explicit transaction. Remember that `GO`
56
+ * is a client-side batch separator rather than a T-SQL statement, and split
57
+ * migrations when SQL Server requires an object definition such as `CREATE
58
+ * VIEW`, `CREATE PROCEDURE`, or `CREATE TRIGGER` to start its own batch. This
59
+ * adapter also does not emit SQL Server schema dumps for `schemaDirectory`.
60
+ *
61
+ * @since 4.0.0
15
62
  */
16
63
  export * as MssqlMigrator from "./MssqlMigrator.ts";
17
64
  /**
18
- * @since 1.0.0
65
+ * Typed metadata for SQL Server stored procedure parameters.
66
+ *
67
+ * This module records the bare parameter name, Tedious `DataType`, Tedious
68
+ * `ParameterOptions`, and phantom TypeScript value type used by
69
+ * `Procedure.param` and `Procedure.outputParam`. `MssqlClient.call` later
70
+ * forwards input parameters to Tedious with `Request.addParameter` and output
71
+ * parameters with `Request.addOutputParameter`, so names should match the
72
+ * stored procedure parameter name without a leading `@`.
73
+ *
74
+ * Use these values when defining stored procedures that need explicit SQL
75
+ * Server parameter metadata, such as sized strings or binary values, decimal
76
+ * precision/scale, table-valued parameters, and output parameters. The generic
77
+ * type parameter is only a compile-time guide for the value record accepted by
78
+ * `Procedure.compile`; Tedious still validates and encodes the runtime value.
79
+ * In particular, TVP values must use Tedious' table shape with `name`,
80
+ * optional `schema`, `columns`, and `rows`, and output parameters are registered
81
+ * with no initial value, so SQL Server input-output parameters need separate
82
+ * care rather than assuming an output parameter is populated from compiled
83
+ * input values.
84
+ *
85
+ * @since 4.0.0
19
86
  */
20
87
  export * as Parameter from "./Parameter.ts";
21
88
  /**
22
- * @since 1.0.0
89
+ * Typed builders for Microsoft SQL Server stored procedure definitions.
90
+ *
91
+ * This module describes the metadata consumed by `MssqlClient.call`: create a
92
+ * definition with `make`, add input and output parameters with their Tedious
93
+ * data types and `ParameterOptions`, optionally describe the returned row shape
94
+ * with `withRows`, and use `compile` to bind the input values before execution.
95
+ * It is useful when application code calls stored procedures for commands,
96
+ * reports, migrations, or workflows that return both result sets and output
97
+ * parameters.
98
+ *
99
+ * Parameter value types are supplied explicitly through `param<A>()` and
100
+ * `outputParam<A>()`; they are not inferred from the Tedious data type. Input
101
+ * values must be keyed by the parameter names in the definition, output
102
+ * parameters are collected separately from returned rows, and `withRows` only
103
+ * records the expected TypeScript row type, so row names and transforms still
104
+ * follow the configured `MssqlClient` result handling.
105
+ *
106
+ * @since 4.0.0
23
107
  */
24
108
  export * as Procedure from "./Procedure.ts";
25
109
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO;AACL;;GAEG;AACH,KAAK,IAAI,UAAU,EACpB,MAAM,SAAS,CAAA;AAIhB;;GAEG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;GAEG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;GAEG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;GAEG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO;AACL;;GAEG;AACH,KAAK,IAAI,UAAU,EACpB,MAAM,SAAS,CAAA;AAIhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA"}
package/dist/index.js CHANGED
@@ -1,26 +1,110 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * @since 4.0.0
3
3
  */
4
4
  export {
5
5
  /**
6
- * @since 1.0.0
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 1.0.0
11
+ * Microsoft SQL Server client implementation for Effect SQL, backed by the
12
+ * `tedious` driver.
13
+ *
14
+ * This module provides the `MssqlClient` service and layers that also satisfy
15
+ * the generic `SqlClient` service. It is intended for server applications,
16
+ * background workers, migrations, and tests that need SQL Server query
17
+ * compilation, Tedious parameter typing, scoped connection management,
18
+ * transactions, and typed stored procedure calls.
19
+ *
20
+ * Clients own a scoped pool of Tedious connections and validate startup with
21
+ * `SELECT 1`. Regular queries borrow a pooled connection per operation, while
22
+ * transactions keep one pooled connection for their lifetime and use SQL Server
23
+ * savepoints for nested transactions. Long-running transactions therefore
24
+ * reduce available pool capacity; size `maxConnections`, `connectionTTL`, and
25
+ * `connectTimeout` accordingly.
26
+ *
27
+ * Tedious permits one active request per connection. This client compiles
28
+ * statements with named `@1`-style parameters, maps Effect SQL primitive values
29
+ * to Tedious `DataType`s unless `param` is used, and does not implement
30
+ * streaming queries. Be deliberate about TLS options: `encrypt` defaults to
31
+ * `false` and `trustServerCertificate` defaults to `true` unless overridden.
32
+ * Stored procedure calls go through `callProcedure`; define input and output
33
+ * parameters with the `Procedure` and `Parameter` helpers so Tedious receives
34
+ * the correct data types and output values can be collected from `returnValue`
35
+ * events.
36
+ *
37
+ * @since 4.0.0
12
38
  */
13
39
  export * as MssqlClient from "./MssqlClient.js";
14
40
  /**
15
- * @since 1.0.0
41
+ * Utilities for applying Effect SQL migrations to Microsoft SQL Server.
42
+ *
43
+ * This module re-exports the shared `Migrator` loaders and error types, then
44
+ * provides `run` and `layer` helpers for applying ordered migrations through
45
+ * the current SQL Server `SqlClient`. It is typically used at application
46
+ * startup, during deployment, in integration tests that provision temporary SQL
47
+ * Server databases, or in layer graphs that need the database schema to be
48
+ * current before dependent services are acquired.
49
+ *
50
+ * Applied migrations are stored in `effect_sql_migrations` by default and use
51
+ * the shared `<id>_<name>` loader convention. Only migrations with ids greater
52
+ * than the latest recorded id are run, so avoid inserting older migration ids
53
+ * after a later migration has reached production. SQL Server migrations run
54
+ * inside the shared migrator transaction and this adapter does not add a
55
+ * dialect-specific table lock, so coordinate concurrent startup runners and
56
+ * write T-SQL that is valid inside an explicit transaction. Remember that `GO`
57
+ * is a client-side batch separator rather than a T-SQL statement, and split
58
+ * migrations when SQL Server requires an object definition such as `CREATE
59
+ * VIEW`, `CREATE PROCEDURE`, or `CREATE TRIGGER` to start its own batch. This
60
+ * adapter also does not emit SQL Server schema dumps for `schemaDirectory`.
61
+ *
62
+ * @since 4.0.0
16
63
  */
17
64
  export * as MssqlMigrator from "./MssqlMigrator.js";
18
65
  /**
19
- * @since 1.0.0
66
+ * Typed metadata for SQL Server stored procedure parameters.
67
+ *
68
+ * This module records the bare parameter name, Tedious `DataType`, Tedious
69
+ * `ParameterOptions`, and phantom TypeScript value type used by
70
+ * `Procedure.param` and `Procedure.outputParam`. `MssqlClient.call` later
71
+ * forwards input parameters to Tedious with `Request.addParameter` and output
72
+ * parameters with `Request.addOutputParameter`, so names should match the
73
+ * stored procedure parameter name without a leading `@`.
74
+ *
75
+ * Use these values when defining stored procedures that need explicit SQL
76
+ * Server parameter metadata, such as sized strings or binary values, decimal
77
+ * precision/scale, table-valued parameters, and output parameters. The generic
78
+ * type parameter is only a compile-time guide for the value record accepted by
79
+ * `Procedure.compile`; Tedious still validates and encodes the runtime value.
80
+ * In particular, TVP values must use Tedious' table shape with `name`,
81
+ * optional `schema`, `columns`, and `rows`, and output parameters are registered
82
+ * with no initial value, so SQL Server input-output parameters need separate
83
+ * care rather than assuming an output parameter is populated from compiled
84
+ * input values.
85
+ *
86
+ * @since 4.0.0
20
87
  */
21
88
  export * as Parameter from "./Parameter.js";
22
89
  /**
23
- * @since 1.0.0
90
+ * Typed builders for Microsoft SQL Server stored procedure definitions.
91
+ *
92
+ * This module describes the metadata consumed by `MssqlClient.call`: create a
93
+ * definition with `make`, add input and output parameters with their Tedious
94
+ * data types and `ParameterOptions`, optionally describe the returned row shape
95
+ * with `withRows`, and use `compile` to bind the input values before execution.
96
+ * It is useful when application code calls stored procedures for commands,
97
+ * reports, migrations, or workflows that return both result sets and output
98
+ * parameters.
99
+ *
100
+ * Parameter value types are supplied explicitly through `param<A>()` and
101
+ * `outputParam<A>()`; they are not inferred from the Tedious data type. Input
102
+ * values must be keyed by the parameter names in the definition, output
103
+ * parameters are collected separately from returned rows, and `withRows` only
104
+ * records the expected TypeScript row type, so row names and transforms still
105
+ * follow the configured `MssqlClient` result handling.
106
+ *
107
+ * @since 4.0.0
24
108
  */
25
109
  export * as Procedure from "./Procedure.js";
26
110
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["TYPES","MssqlTypes","MssqlClient","MssqlMigrator","Parameter","Procedure"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AACE;;;AAGAA,KAAK,IAAIC,UAAU,QACd,SAAS;AAEhB;AAEA;;;AAGA,OAAO,KAAKC,WAAW,MAAM,kBAAkB;AAE/C;;;AAGA,OAAO,KAAKC,aAAa,MAAM,oBAAoB;AAEnD;;;AAGA,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAE3C;;;AAGA,OAAO,KAAKC,SAAS,MAAM,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["TYPES","MssqlTypes","MssqlClient","MssqlMigrator","Parameter","Procedure"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AACE;;;AAGAA,KAAK,IAAIC,UAAU,QACd,SAAS;AAEhB;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,OAAO,KAAKC,WAAW,MAAM,kBAAkB;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,OAAO,KAAKC,aAAa,MAAM,oBAAoB;AAEnD;;;;;;;;;;;;;;;;;;;;;;;AAuBA,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAE3C;;;;;;;;;;;;;;;;;;;;AAoBA,OAAO,KAAKC,SAAS,MAAM,gBAAgB","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect/sql-mssql",
3
- "version": "4.0.0-beta.7",
3
+ "version": "4.0.0-beta.70",
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.7"
46
+ "effect": "^4.0.0-beta.70"
47
47
  },
48
48
  "peerDependencies": {
49
- "effect": "^4.0.0-beta.7"
49
+ "effect": "^4.0.0-beta.70"
50
50
  },
51
51
  "dependencies": {
52
- "tedious": "^19.2.0"
52
+ "tedious": "^19.2.1"
53
53
  },
54
54
  "scripts": {
55
55
  "codegen": "effect-utils codegen",