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`",