From 42ac7c9c6982064a73540915bcce47033a46baea Mon Sep 17 00:00:00 2001 From: Igal Klebanov Date: Mon, 10 Jun 2024 08:51:46 +0300 Subject: [PATCH] move `preventAwait` to `alter-column-builder`.ts. (#1031) --- src/schema/alter-column-builder.ts | 5 +++++ src/schema/alter-table-builder.ts | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/schema/alter-column-builder.ts b/src/schema/alter-column-builder.ts index caa41b04d..61cf708cd 100644 --- a/src/schema/alter-column-builder.ts +++ b/src/schema/alter-column-builder.ts @@ -8,6 +8,7 @@ import { DefaultValueExpression, parseDefaultValueExpression, } from '../parser/default-value-parser.js' +import { preventAwait } from '../util/prevent-await.js' export class AlterColumnBuilder { readonly #column: string @@ -63,6 +64,8 @@ export class AlterColumnBuilder { } } +preventAwait(AlterColumnBuilder, "don't await AlterColumnBuilder instances") + /** * Allows us to force consumers to do exactly one alteration to a column. * @@ -93,3 +96,5 @@ export class AlteredColumnBuilder implements OperationNodeSource { export type AlterColumnBuilderCallback = ( builder: AlterColumnBuilder, ) => AlteredColumnBuilder + +preventAwait(AlteredColumnBuilder, "don't await AlteredColumnBuilder instances") diff --git a/src/schema/alter-table-builder.ts b/src/schema/alter-table-builder.ts index c55901b8d..b7bee0308 100644 --- a/src/schema/alter-table-builder.ts +++ b/src/schema/alter-table-builder.ts @@ -323,6 +323,8 @@ export interface AlterTableBuilderProps { readonly node: AlterTableNode } +preventAwait(AlterTableBuilder, "don't await AlterTableBuilder instances") + export interface ColumnAlteringInterface { alterColumn( column: string, @@ -469,9 +471,6 @@ export class AlterTableColumnAlteringBuilder export interface AlterTableColumnAlteringBuilderProps extends AlterTableBuilderProps {} -preventAwait(AlterTableBuilder, "don't await AlterTableBuilder instances") -preventAwait(AlterColumnBuilder, "don't await AlterColumnBuilder instances") - preventAwait( AlterTableColumnAlteringBuilder, "don't await AlterTableColumnAlteringBuilder instances directly. To execute the query you need to call `execute`",