-
Couldn't load subscription status.
- Fork 350
feat(schema): col.defaultCurrentTimestamp(precision?) [REOPENED]
#1454
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
base: next
Are you sure you want to change the base?
feat(schema): col.defaultCurrentTimestamp(precision?) [REOPENED]
#1454
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
commit: |
b79fc4b to
aeae046
Compare
aeae046 to
18ed284
Compare
18ed284 to
586f3a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a shorthand method, defaultCurrentTimestamp, to simplify setting a column’s default value to the current timestamp with optional precision.
- Adds a defaultCurrentTimestamp method to column-definition builders.
- Updates tests to use defaultCurrentTimestamp instead of defaultTo(sql
current_timestamp). - Introduces a new date-parser utility with a TimestampPrecision type and corresponding parsing function.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/node/src/schema.test.ts | Replaces previous defaultTo usage with defaultCurrentTimestamp. |
| src/schema/column-definition-builder.ts | Adds the defaultCurrentTimestamp method and updates documentation. |
| src/parser/date-parser.ts | Implements parseCurrentTimestamp and defines TimestampPrecision. |
| src/index.ts | Exports TimestampPrecision from the date-parser. |
col.defaultCurrentTimestamp(precision?) [REOPENED]
d88f32a to
be8e7f8
Compare
be8e7f8 to
0afadf7
Compare
cdd1cd9 to
bdeb0e8
Compare
0afadf7 to
f72edb8
Compare
Co-authored-by: Eric So <56284867+ericsodev@users.noreply.github.com> Co-authored-by: Igal Klebanov <igalklebanov@gmail.com>
Co-authored-by: Austin Woon Quan <43132101+austinwoon@users.noreply.github.com> minor adjustments to naming and jsdocs. ...
f72edb8 to
3479909
Compare
f13491f to
90d6c71
Compare
f3c3650 to
9adaf87
Compare
bdf82d9 to
33e2a45
Compare
Hey 👋
reopens #1175 by @austinwoon (was accidentally closed when the
0.28branch was destroyed).Closes #1162
This PR adds:
As a shorthand of:
You can also: