Skip to content

INTERVAL support, date pseudo literals TIMESTAMP and TIME literals. #255

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kchasapis
Copy link

The interval was not allowed to be a column data type. With this patch we add this support.

We add support for the pseudo literals
CURRENT_TIME, CURRENT_TIMESTAMP, CURRENT_DATE.

Also, we add support for TIMESTAMP and TIME literals. The user can now explicitly set the type of the string value it follows with TIMESTAMP 'value' and TIME 'value.

DATE was already supported.

@kchasapis kchasapis force-pushed the interval_date_psedo_literals branch from 08fe178 to d2da311 Compare June 4, 2025 14:52
Copy link
Member

@dey4ss dey4ss left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! Before I go into detail reviewing your changes, can you please add some unit tests?

@@ -61,6 +61,7 @@ struct ColumnDefinition : TableElement {
ColumnType type;
bool nullable;
std::vector<ReferencesSpecification*>* references;
Expr* defaultValue{nullptr};
Copy link
Member

Choose a reason for hiding this comment

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

This member is unused, isn't it?

Copy link
Author

Choose a reason for hiding this comment

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

@dey4ss I have deleted it.

@kchasapis kchasapis force-pushed the interval_date_psedo_literals branch from d2da311 to 9109fe0 Compare June 16, 2025 22:36
The interval was not allowed to be a column data type.
With this patch we add this support.

We add support for the pseudo literals
CURRENT_TIME, CURRENT_TIMESTAMP, CURRENT_DATE.

Also, we add support for TIMESTAMP and TIME literals.
The user can now explicitly set the type of the string value it follows
with TIMESTAMP 'value' and TIME 'value.

DATE was already supported.
@kchasapis kchasapis force-pushed the interval_date_psedo_literals branch from 9109fe0 to ef49bda Compare June 16, 2025 22:43
@kchasapis
Copy link
Author

Thank you for your contribution! Before I go into detail reviewing your changes, can you please add some unit tests?

Thanks for your message. I have added unit tests. Please, let me know if there is anything else needed from my side to get started in the review.

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.

2 participants