(t time.Time)
| 1665 | } |
| 1666 | |
| 1667 | func timeString(t time.Time) string { |
| 1668 | // SQLite times are really strings, and may god help your immortal soul if |
| 1669 | // you don't use this exact format when storing them (including similar |
| 1670 | // looking more common formats like RFC3339). They'll store fine, produce no |
| 1671 | // warnings, and then just won't compare properly against built-ins, causing |
| 1672 | // everything to fail in non-obvious ways. |
| 1673 | const sqliteFormat = "2006-01-02 15:04:05.999" |
| 1674 | |
| 1675 | return t.UTC().Round(time.Millisecond).Format(sqliteFormat) |
| 1676 | } |
| 1677 | |
| 1678 | // This is kind of unfortunate, but I've found it the easiest way to encode an |
| 1679 | // optional date/time. Unfortunately sqlc (or the driver? not sure) will write a |
no outgoing calls
searching dependent graphs…