Skip to content

Commit c3c88e6

Browse files
committed
Allow manipulating the values to update in all update cases
1 parent 2668a2e commit c3c88e6

File tree

1 file changed

+117
-0
lines changed

1 file changed

+117
-0
lines changed

src/expressions/update.ts

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,45 @@ export interface ShapedExecutableUpdateExpression<TABLE extends ITableOrView<any
117117
ignoreIfHasNoValue(...columns: ColumnsForSetOfWithShape<TABLE, SHAPE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
118118
ignoreAnySetWithNoValue(): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
119119

120+
disallowIfSet(errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
121+
disallowIfSet(error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
122+
disallowIfNotSet(errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
123+
disallowIfNotSet(error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
124+
disallowIfValue(errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
125+
disallowIfValue(error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
126+
disallowIfNoValue(errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
127+
disallowIfNoValue(error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
128+
disallowAnyOtherSet(errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
129+
disallowAnyOtherSet(error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
130+
131+
setWhen(when: boolean, columns: UpdateSets<TABLE, USING, undefined>): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
132+
setIfValueWhen(when: boolean, columns: OptionalUpdateSets<TABLE, USING, undefined>): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
133+
setIfSetWhen(when: boolean, columns: UpdateSets<TABLE, USING, undefined>): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
134+
setIfSetIfValueWhen(when: boolean, columns: OptionalUpdateSets<TABLE, USING, undefined>): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
135+
setIfNotSetWhen(when: boolean, columns: UpdateSets<TABLE, USING, undefined>): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
136+
setIfNotSetIfValueWhen(when: boolean, columns: OptionalUpdateSets<TABLE, USING, undefined>): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
137+
ignoreIfSetWhen(when: boolean, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
138+
keepOnlyWhen(when: boolean, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
139+
140+
setIfHasValueWhen(when: boolean, columns: UpdateSets<TABLE, USING, undefined>): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
141+
setIfHasValueIfValueWhen(when: boolean, columns: OptionalUpdateSets<TABLE, USING, undefined>): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
142+
setIfHasNoValueWhen(when: boolean, columns: UpdateSets<TABLE, USING, undefined>): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
143+
setIfHasNoValueIfValueWhen(when: boolean, columns: OptionalUpdateSets<TABLE, USING, undefined>): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
144+
ignoreIfHasValueWhen(when: boolean, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
145+
ignoreIfHasNoValueWhen(when: boolean, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
146+
ignoreAnySetWithNoValueWhen(when: boolean): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
147+
148+
disallowIfSetWhen(when: boolean, errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
149+
disallowIfSetWhen(when: boolean, error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
150+
disallowIfNotSetWhen(when: boolean, errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
151+
disallowIfNotSetWhen(when: boolean, error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
152+
disallowIfValueWhen(when: boolean, errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
153+
disallowIfValueWhen(when: boolean, error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
154+
disallowIfNoValueWhen(when: boolean, errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
155+
disallowIfNoValueWhen(when: boolean, error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
156+
disallowAnyOtherSetWhen(when: boolean, errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
157+
disallowAnyOtherSetWhen(when: boolean, error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedExecutableUpdateExpression<TABLE, USING, SHAPE>
158+
120159
dynamicWhere() : DynamicExecutableUpdateExpression<TABLE, USING>
121160
where(condition: IIfValueSource<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, any>): DynamicExecutableUpdateExpression<TABLE, USING>
122161
where(condition: IBooleanValueSource<TABLE[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, any>): DynamicExecutableUpdateExpression<TABLE, USING>
@@ -140,6 +179,45 @@ export interface NotExecutableUpdateExpression<TABLE extends ITableOrView<any>,
140179
ignoreIfHasNoValue(...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
141180
ignoreAnySetWithNoValue(): NotExecutableUpdateExpression<TABLE, USING>
142181

182+
disallowIfSet(errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
183+
disallowIfSet(error: Error, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
184+
disallowIfNotSet(errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
185+
disallowIfNotSet(error: Error, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
186+
disallowIfValue(errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
187+
disallowIfValue(error: Error, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
188+
disallowIfNoValue(errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
189+
disallowIfNoValue(error: Error, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
190+
disallowAnyOtherSet(errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
191+
disallowAnyOtherSet(error: Error, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
192+
193+
setWhen(when: boolean, columns: UpdateSets<TABLE, USING, undefined>): NotExecutableUpdateExpression<TABLE, USING>
194+
setIfValueWhen(when: boolean, columns: OptionalUpdateSets<TABLE, USING, undefined>): NotExecutableUpdateExpression<TABLE, USING>
195+
setIfSetWhen(when: boolean, columns: UpdateSets<TABLE, USING, undefined>): NotExecutableUpdateExpression<TABLE, USING>
196+
setIfSetIfValueWhen(when: boolean, columns: OptionalUpdateSets<TABLE, USING, undefined>): NotExecutableUpdateExpression<TABLE, USING>
197+
setIfNotSetWhen(when: boolean, columns: UpdateSets<TABLE, USING, undefined>): NotExecutableUpdateExpression<TABLE, USING>
198+
setIfNotSetIfValueWhen(when: boolean, columns: OptionalUpdateSets<TABLE, USING, undefined>): NotExecutableUpdateExpression<TABLE, USING>
199+
ignoreIfSetWhen(when: boolean, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
200+
keepOnlyWhen(when: boolean, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
201+
202+
setIfHasValueWhen(when: boolean, columns: UpdateSets<TABLE, USING, undefined>): NotExecutableUpdateExpression<TABLE, USING>
203+
setIfHasValueIfValueWhen(when: boolean, columns: OptionalUpdateSets<TABLE, USING, undefined>): NotExecutableUpdateExpression<TABLE, USING>
204+
setIfHasNoValueWhen(when: boolean, columns: UpdateSets<TABLE, USING, undefined>): NotExecutableUpdateExpression<TABLE, USING>
205+
setIfHasNoValueIfValueWhen(when: boolean, columns: OptionalUpdateSets<TABLE, USING, undefined>): NotExecutableUpdateExpression<TABLE, USING>
206+
ignoreIfHasValueWhen(when: boolean, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
207+
ignoreIfHasNoValueWhen(when: boolean, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
208+
ignoreAnySetWithNoValueWhen(when: boolean): NotExecutableUpdateExpression<TABLE, USING>
209+
210+
disallowIfSetWhen(when: boolean, errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
211+
disallowIfSetWhen(when: boolean, error: Error, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
212+
disallowIfNotSetWhen(when: boolean, errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
213+
disallowIfNotSetWhen(when: boolean, error: Error, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
214+
disallowIfValueWhen(when: boolean, errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
215+
disallowIfValueWhen(when: boolean, error: Error, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
216+
disallowIfNoValueWhen(when: boolean, errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
217+
disallowIfNoValueWhen(when: boolean, error: Error, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
218+
disallowAnyOtherSetWhen(when: boolean, errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
219+
disallowAnyOtherSetWhen(when: boolean, error: Error, ...columns: ColumnsForSetOf<TABLE>[]): NotExecutableUpdateExpression<TABLE, USING>
220+
143221
dynamicWhere() : DynamicExecutableUpdateExpression<TABLE, USING>
144222
where(condition: IIfValueSource<USING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, any>): DynamicExecutableUpdateExpression<TABLE, USING>
145223
where(condition: IBooleanValueSource<USING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, any>): DynamicExecutableUpdateExpression<TABLE, USING>
@@ -164,6 +242,45 @@ export interface ShapedNotExecutableUpdateExpression<TABLE extends ITableOrView<
164242
ignoreIfHasNoValue(...columns: ColumnsForSetOfWithShape<TABLE, SHAPE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
165243
ignoreAnySetWithNoValue(): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
166244

245+
disallowIfSet(errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
246+
disallowIfSet(error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
247+
disallowIfNotSet(errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
248+
disallowIfNotSet(error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
249+
disallowIfValue(errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
250+
disallowIfValue(error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
251+
disallowIfNoValue(errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
252+
disallowIfNoValue(error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
253+
disallowAnyOtherSet(errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
254+
disallowAnyOtherSet(error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
255+
256+
setWhen(when: boolean, columns: UpdateSets<TABLE, USING, undefined>): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
257+
setIfValueWhen(when: boolean, columns: OptionalUpdateSets<TABLE, USING, undefined>): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
258+
setIfSetWhen(when: boolean, columns: UpdateSets<TABLE, USING, undefined>): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
259+
setIfSetIfValueWhen(when: boolean, columns: OptionalUpdateSets<TABLE, USING, undefined>): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
260+
setIfNotSetWhen(when: boolean, columns: UpdateSets<TABLE, USING, undefined>): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
261+
setIfNotSetIfValueWhen(when: boolean, columns: OptionalUpdateSets<TABLE, USING, undefined>): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
262+
ignoreIfSetWhen(when: boolean, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
263+
keepOnlyWhen(when: boolean, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
264+
265+
setIfHasValueWhen(when: boolean, columns: UpdateSets<TABLE, USING, undefined>): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
266+
setIfHasValueIfValueWhen(when: boolean, columns: OptionalUpdateSets<TABLE, USING, undefined>): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
267+
setIfHasNoValueWhen(when: boolean, columns: UpdateSets<TABLE, USING, undefined>): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
268+
setIfHasNoValueIfValueWhen(when: boolean, columns: OptionalUpdateSets<TABLE, USING, undefined>): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
269+
ignoreIfHasValueWhen(when: boolean, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
270+
ignoreIfHasNoValueWhen(when: boolean, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
271+
ignoreAnySetWithNoValueWhen(when: boolean): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
272+
273+
disallowIfSetWhen(when: boolean, errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
274+
disallowIfSetWhen(when: boolean, error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
275+
disallowIfNotSetWhen(when: boolean, errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
276+
disallowIfNotSetWhen(when: boolean, error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
277+
disallowIfValueWhen(when: boolean, errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
278+
disallowIfValueWhen(when: boolean, error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
279+
disallowIfNoValueWhen(when: boolean, errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
280+
disallowIfNoValueWhen(when: boolean, error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
281+
disallowAnyOtherSetWhen(when: boolean, errorMessage: string, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
282+
disallowAnyOtherSetWhen(when: boolean, error: Error, ...columns: ColumnsForSetOf<TABLE>[]): ShapedNotExecutableUpdateExpression<TABLE, USING, SHAPE>
283+
167284
dynamicWhere() : DynamicExecutableUpdateExpression<TABLE, USING>
168285
where(condition: IIfValueSource<USING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, any>): DynamicExecutableUpdateExpression<TABLE, USING>
169286
where(condition: IBooleanValueSource<USING[typeof tableOrViewRef] | NoTableOrViewRequired<TABLE[typeof database]>, any>): DynamicExecutableUpdateExpression<TABLE, USING>

0 commit comments

Comments
 (0)