feat(schema): col.defaultCurrentTimestamp(precision?) [REOPENED]#1454
Open
igalklebanov wants to merge 7 commits intokysely-org:nextfrom
Open
feat(schema): col.defaultCurrentTimestamp(precision?) [REOPENED]#1454igalklebanov wants to merge 7 commits intokysely-org:nextfrom
col.defaultCurrentTimestamp(precision?) [REOPENED]#1454igalklebanov wants to merge 7 commits intokysely-org:nextfrom
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
Contributor
There was a problem hiding this comment.
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
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
f257ae4 to
c85d7c2
Compare
06eca6f to
500a250
Compare
ebcfe24 to
2ef37b3
Compare
a859b43 to
362a67a
Compare
63af1a3 to
0cf6dcb
Compare
ca8e49a to
9f037a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: