@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/src/Procedure.ts CHANGED
@@ -1,5 +1,13 @@
1
1
  /**
2
- * @since 1.0.0
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 type { Pipeable } from "effect/Pipeable"
@@ -11,20 +19,26 @@ import type { ParameterOptions } from "tedious/lib/request.ts"
11
19
  import * as Parameter from "./Parameter.ts"
12
20
 
13
21
  /**
14
- * @category type id
15
- * @since 1.0.0
22
+ * Runtime type identifier used to mark SQL Server stored procedure definitions.
23
+ *
24
+ * @category type IDs
25
+ * @since 4.0.0
16
26
  */
17
27
  export const TypeId: TypeId = "~@effect/sql-mssql/Procedure"
18
28
 
19
29
  /**
20
- * @category type id
21
- * @since 1.0.0
30
+ * Type-level identifier used to mark SQL Server stored procedure definitions.
31
+ *
32
+ * @category type IDs
33
+ * @since 4.0.0
22
34
  */
23
35
  export type TypeId = "~@effect/sql-mssql/Procedure"
24
36
 
25
37
  /**
26
- * @category model
27
- * @since 1.0.0
38
+ * Pipeable definition of a SQL Server stored procedure, tracking its input parameters, output parameters, and result row type.
39
+ *
40
+ * @category models
41
+ * @since 4.0.0
28
42
  */
29
43
  export interface Procedure<
30
44
  I extends Record<string, Parameter.Parameter<any>>,
@@ -41,8 +55,10 @@ export interface Procedure<
41
55
  }
42
56
 
43
57
  /**
44
- * @category model
45
- * @since 1.0.0
58
+ * Stored procedure definition with concrete input values bound for execution.
59
+ *
60
+ * @category models
61
+ * @since 4.0.0
46
62
  */
47
63
  export interface ProcedureWithValues<
48
64
  I extends Record<string, Parameter.Parameter<any>>,
@@ -53,11 +69,16 @@ export interface ProcedureWithValues<
53
69
  }
54
70
 
55
71
  /**
56
- * @since 1.0.0
72
+ * Namespace containing type helpers and result types for SQL Server stored procedures.
73
+ *
74
+ * @since 4.0.0
57
75
  */
58
- export namespace Procedure {
76
+ export declare namespace Procedure {
59
77
  /**
60
- * @since 1.0.0
78
+ * Maps a record of `Parameter` metadata to the corresponding record of parameter value types.
79
+ *
80
+ * @category utility types
81
+ * @since 4.0.0
61
82
  */
62
83
  export type ParametersRecord<
63
84
  A extends Record<string, Parameter.Parameter<any>>
@@ -69,8 +90,10 @@ export namespace Procedure {
69
90
  & {}
70
91
 
71
92
  /**
72
- * @category model
73
- * @since 1.0.0
93
+ * Result of a SQL Server stored procedure call, containing typed output parameter values and returned rows.
94
+ *
95
+ * @category models
96
+ * @since 4.0.0
74
97
  */
75
98
  export interface Result<
76
99
  O extends Record<string, Parameter.Parameter<any>>,
@@ -94,8 +117,10 @@ const procedureProto = {
94
117
  }
95
118
 
96
119
  /**
97
- * @category constructor
98
- * @since 1.0.0
120
+ * Creates an empty SQL Server stored procedure definition for the given procedure name.
121
+ *
122
+ * @category constructors
123
+ * @since 4.0.0
99
124
  */
100
125
  export const make = (name: string): Procedure<{}, {}> => {
101
126
  const procedure = Object.create(procedureProto)
@@ -106,8 +131,10 @@ export const make = (name: string): Procedure<{}, {}> => {
106
131
  }
107
132
 
108
133
  /**
109
- * @category combinator
110
- * @since 1.0.0
134
+ * Adds a typed input parameter to a SQL Server stored procedure definition.
135
+ *
136
+ * @category combinators
137
+ * @since 4.0.0
111
138
  */
112
139
  export const param = <A>() =>
113
140
  <N extends string, T extends DataType>(
@@ -129,8 +156,10 @@ export const param = <A>() =>
129
156
  })
130
157
 
131
158
  /**
132
- * @category combinator
133
- * @since 1.0.0
159
+ * Adds a typed output parameter to a SQL Server stored procedure definition.
160
+ *
161
+ * @category combinators
162
+ * @since 4.0.0
134
163
  */
135
164
  export const outputParam = <A>() =>
136
165
  <N extends string, T extends DataType>(
@@ -152,8 +181,10 @@ export const outputParam = <A>() =>
152
181
  })
153
182
 
154
183
  /**
155
- * @category combinator
156
- * @since 1.0.0
184
+ * Sets the expected row type for a SQL Server stored procedure definition.
185
+ *
186
+ * @category combinators
187
+ * @since 4.0.0
157
188
  */
158
189
  export const withRows = <A extends object = Row>() =>
159
190
  <
@@ -164,8 +195,10 @@ export const withRows = <A extends object = Row>() =>
164
195
  ): Procedure<I, O, A> => self as any
165
196
 
166
197
  /**
167
- * @category combinator
168
- * @since 1.0.0
198
+ * Binds input values to a SQL Server stored procedure definition, producing a value that can be executed with `MssqlClient.call`.
199
+ *
200
+ * @category combinators
201
+ * @since 4.0.0
169
202
  */
170
203
  export const compile = <
171
204
  I extends Record<string, Parameter.Parameter<any>>,
package/src/index.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * @since 4.0.0
3
3
  */
4
4
 
5
5
  export {
6
6
  /**
7
- * @since 1.0.0
7
+ * @since 4.0.0
8
8
  */
9
9
  TYPES as MssqlTypes
10
10
  } from "tedious"
@@ -12,21 +12,21 @@ export {
12
12
  // @barrel: Auto-generated exports. Do not edit manually.
13
13
 
14
14
  /**
15
- * @since 1.0.0
15
+ * @since 4.0.0
16
16
  */
17
17
  export * as MssqlClient from "./MssqlClient.ts"
18
18
 
19
19
  /**
20
- * @since 1.0.0
20
+ * @since 4.0.0
21
21
  */
22
22
  export * as MssqlMigrator from "./MssqlMigrator.ts"
23
23
 
24
24
  /**
25
- * @since 1.0.0
25
+ * @since 4.0.0
26
26
  */
27
27
  export * as Parameter from "./Parameter.ts"
28
28
 
29
29
  /**
30
- * @since 1.0.0
30
+ * @since 4.0.0
31
31
  */
32
32
  export * as Procedure from "./Procedure.ts"