mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:47:32 +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:
@@ -19,7 +19,12 @@ func (c *Config) SetConnector(connector dialect.Connector) {
|
||||
c.connector = connector
|
||||
}
|
||||
|
||||
func Connect(config Config, useAdmin bool) (*sql.DB, error) {
|
||||
type DB struct {
|
||||
*sql.DB
|
||||
dialect.Database
|
||||
}
|
||||
|
||||
func Connect(config Config, useAdmin bool) (*DB, error) {
|
||||
client, err := config.connector.Connect(useAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -29,7 +34,10 @@ func Connect(config Config, useAdmin bool) (*sql.DB, error) {
|
||||
return nil, errors.ThrowPreconditionFailed(err, "DATAB-0pIWD", "Errors.Database.Connection.Failed")
|
||||
}
|
||||
|
||||
return client, nil
|
||||
return &DB{
|
||||
DB: client,
|
||||
Database: config.connector,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func DecodeHook(from, to reflect.Value) (interface{}, error) {
|
||||
@@ -61,7 +69,7 @@ func DecodeHook(from, to reflect.Value) (interface{}, error) {
|
||||
return Config{connector: connector}, nil
|
||||
}
|
||||
|
||||
func (c Config) Database() string {
|
||||
func (c Config) DatabaseName() string {
|
||||
return c.connector.DatabaseName()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user