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

Improve Typing: add typescript support for deferrable, new Primary/Unique syntax #4589

Merged
merged 3 commits into from Jul 29, 2021

Conversation

zeotuan
Copy link
Contributor

@zeotuan zeotuan commented Jul 27, 2021

also addressing missing datetime missing in
close #3944

@@ -1908,12 +1909,16 @@ export declare namespace Knex {
uuid(columnName: string): ColumnBuilder;
comment(val: string): TableBuilder;
specificType(columnName: string, type: string): ColumnBuilder;
primary(columnNames: readonly string[], options?: Readonly<{constraintName?: string, deferrable?: deferrableType}>): TableBuilder;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New type for primary using options object

primary(columnNames: readonly string[], constraintName?: string): TableBuilder;
index(
columnNames: string | readonly (string | Raw)[],
indexName?: string,
indexType?: string
): TableBuilder;
unique(columnNames: readonly (string | Raw)[], options?: Readonly<{indexName?: string, deferrable?: deferrableType}>): TableBuilder;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added type for unique using options object

@@ -1908,12 +1909,16 @@ export declare namespace Knex {
uuid(columnName: string): ColumnBuilder;
comment(val: string): TableBuilder;
specificType(columnName: string, type: string): ColumnBuilder;
primary(columnNames: readonly string[], options?: Readonly<{constraintName?: string, deferrable?: deferrableType}>): TableBuilder;
/** @deprecated */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add deprecate tag for old syntax

@zeotuan
Copy link
Contributor Author

zeotuan commented Jul 29, 2021

@kibertoad Hi i added type support for the the new deferrable support that was added. Also added a datetime type

@kibertoad kibertoad merged commit b71f0af into knex:master Jul 29, 2021
OlivierCavadenti pushed a commit to AbeonaPascha/knex that referenced this pull request Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent camelCase use for datetime in schema
2 participants