Skip to content

Commit

Permalink
Advanced visibility for SQLite
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigozhou committed Feb 3, 2023
1 parent e43e5b5 commit 42950d8
Show file tree
Hide file tree
Showing 7 changed files with 427 additions and 207 deletions.
2 changes: 2 additions & 0 deletions common/persistence/sql/sqlplugin/sqlite/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,7 @@ func buildDSNAttr(cfg *config.SQL) (url.Values, error) {
// assume pragma
parameters.Add("_pragma", fmt.Sprintf("%s=%s", key, value))
}
// set time format
parameters.Add("_time_format", "sqlite")
return parameters, nil
}
2 changes: 1 addition & 1 deletion common/persistence/sql/sqlplugin/sqlite/typeconv.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (c *converter) ToSQLiteDateTime(t time.Time) time.Time {
if t.IsZero() {
return minSQLiteDateTime
}
return t.UTC()
return t.UTC().Truncate(time.Microsecond)
}

// FromSQLiteDateTime converts SQLite datetime and returns go time
Expand Down
Loading

0 comments on commit 42950d8

Please sign in to comment.