vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.67k stars 2.1k forks source link

sqltypes: add ToTime conversion funcs #17178

Open derekperkins opened 1 week ago

derekperkins commented 1 week ago

there are already conversions for other native types, but datetime conversions were only available in the vitessdriver. This moves that implementation into sqltypes, so it can be more easily accessed elsewhere. I'm specifically interested in using this with VStream.

The actual implementation was done by @vmg in the driver in 2017, so this just moves it into the sqltypes package, adding a similar ToTime method on Value

Checklist

vitess-bot[bot] commented 1 week ago

Review Checklist

Hello reviewers! :wave: Please follow this checklist when reviewing this Pull Request.

General

Tests

Documentation

New flags

If a workflow is added or modified:

Backward compatibility

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 86.04651% with 6 lines in your changes missing coverage. Please review.

Project coverage is 67.31%. Comparing base (f6ca94f) to head (fb6115e). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
go/sqltypes/value.go 85.36% 6 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #17178 +/- ## ========================================== - Coverage 67.33% 67.31% -0.03% ========================================== Files 1569 1569 Lines 252244 252487 +243 ========================================== + Hits 169858 169961 +103 - Misses 82386 82526 +140 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.