formatTS formats t into a format postgres understands.
(t time.Time)
| 324 | |
| 325 | // formatTS formats t into a format postgres understands. |
| 326 | func formatTS(t time.Time) []byte { |
| 327 | if infinityTSEnabled { |
| 328 | // t <= -infinity : ! (t > -infinity) |
| 329 | if !t.After(infinityTSNegative) { |
| 330 | return []byte("-infinity") |
| 331 | } |
| 332 | // t >= infinity : ! (!t < infinity) |
| 333 | if !t.Before(infinityTSPositive) { |
| 334 | return []byte("infinity") |
| 335 | } |
| 336 | } |
| 337 | return FormatTimestamp(t) |
| 338 | } |
| 339 | |
| 340 | // FormatTimestamp formats t into Postgres' text format for timestamps. |
| 341 | func FormatTimestamp(t time.Time) []byte { |
no test coverage detected
searching dependent graphs…