mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-19 19:48:45 +00:00
perf: query data AS OF SYSTEM TIME (#5231)
Queries the data in the storage layser at the timestamp when the call hit the API layer
This commit is contained in:
@@ -2,6 +2,7 @@ package cockroach
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -89,6 +90,15 @@ func (c *Config) Type() string {
|
||||
return "cockroach"
|
||||
}
|
||||
|
||||
func (c *Config) Timetravel(d time.Duration) string {
|
||||
// verify that it is at least 1 micro second
|
||||
if d < time.Microsecond {
|
||||
d = time.Microsecond
|
||||
}
|
||||
|
||||
return fmt.Sprintf(" AS OF SYSTEM TIME '-%d µs' ", d.Microseconds())
|
||||
}
|
||||
|
||||
type User struct {
|
||||
Username string
|
||||
Password string
|
||||
|
||||
Reference in New Issue
Block a user