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
support DEFAULT keyword #37
Conversation
Any chances of by when this would be merged and available as a feature ? We have been using Hammer as our schema management tool, but this feature being available in Spanner and missing in Hammer is causing us to not utilize the feature. |
Sorry for the late reply. I had missed this PR. @neglect-yp The test for the default value of the timestamp is giving me an error, can you fix that part? |
Sorry. I only partially ran some tests after googleapis/google-cloud-go#6077. I fixed the test at c5dec3a. Please rerun CI. |
And I added some test cases to guarantee |
Merged. thank you! |
Hi We are getting following error: Syntax error on line 3, column 32: Expecting ')' but found 'DEFAULT' CREATE TABLE best_table_name (
primary_key_attribute STRING(36) NOT NULL,
best_boolean_attribute_name BOOL NOT NULL DEFAULT (FALSE),
inserted_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL
) PRIMARY KEY(primary_key_attribute); As per this MR hammer supports DEFAULT keyword, so confused if that' something we are doing wrong in our schema DDL. |
I have tried to reproduce that error using the following steps, but could not reproduce it.
SHA-256 checksum of my hammer binary is
|
Thanks @daichirata for replying so quickly, was just checking and it seems that error is not from the sql that I am trying to apply but rather from the parsing that hammer is trying to do from what' already in the spanner DB. it' basically failing on while parsing the below line in our schema: expiry_at TIMESTAMP AS (IF(another_column_name IS NULL AND status='open', updated_at, '9000-01-01 00:00:00 UTC')) STORED, |
It seems to be the same issue with #38. |
@neglect-yp yeah but that subsequent MR referred in the above MR is already merged, so this means it would still be sometime before these conditions will be supported correct ? |
@hhanda I have not checked your entire DDL, so I do not know if support for only IF and IFNULL expressions is sufficient. |
close: #36
This PR does following things to add support for the
DEFAULT
keyword.DEFAULT
keyword tohammer.AlterColumn
andhammer.Update
NOT NULL
column is added