Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move preventAwait to alter-column-builder.ts. #1031

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/schema/alter-column-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -93,3 +96,5 @@ export class AlteredColumnBuilder implements OperationNodeSource {
export type AlterColumnBuilderCallback = (
builder: AlterColumnBuilder,
) => AlteredColumnBuilder

preventAwait(AlteredColumnBuilder, "don't await AlteredColumnBuilder instances")
5 changes: 2 additions & 3 deletions src/schema/alter-table-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ export interface AlterTableBuilderProps {
readonly node: AlterTableNode
}

preventAwait(AlterTableBuilder, "don't await AlterTableBuilder instances")

export interface ColumnAlteringInterface {
alterColumn(
column: string,
Expand Down Expand Up @@ -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`",
Expand Down