Skip to content

retrieve timestamp precision from DB#16

Merged
jinzhu merged 1 commit intogo-gorm:masterfrom
asmeikal:master
Oct 22, 2020
Merged

retrieve timestamp precision from DB#16
jinzhu merged 1 commit intogo-gorm:masterfrom
asmeikal:master

Conversation

@asmeikal
Copy link
Copy Markdown
Contributor

@asmeikal asmeikal commented Oct 22, 2020

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

Precision for timestamps is stored in the datetime_precision column of information_schema.columns.
This PR takes the datetime_precision and returns it from the DecimalPrecision function.

There is also a fix for the DataTypeOf function: the precision was not taken into account when creating a new datetime column.

@jinzhu jinzhu merged commit 166a7ee into go-gorm:master Oct 22, 2020
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