mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-21 10:58:25 +00:00
Revert "fix(eventstore): use decimal for position (#9881)"
This reverts commit e14639c0ad
.
This commit is contained in:
@@ -2,14 +2,13 @@ package eventstore_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/cockroachdb/cockroach-go/v2/testserver"
|
||||
pgxdecimal "github.com/jackc/pgx-shopspring-decimal"
|
||||
"github.com/jackc/pgx/v5"
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
"github.com/jackc/pgx/v5/stdlib"
|
||||
"github.com/zitadel/logging"
|
||||
@@ -42,15 +41,13 @@ func TestMain(m *testing.M) {
|
||||
testCRDBClient = &database.DB{
|
||||
Database: new(testDB),
|
||||
}
|
||||
config, err := pgxpool.ParseConfig(ts.PGURL().String())
|
||||
|
||||
connConfig, err := pgxpool.ParseConfig(ts.PGURL().String())
|
||||
if err != nil {
|
||||
logging.WithFields("error", err).Fatal("unable to parse db config")
|
||||
logging.WithFields("error", err).Fatal("unable to parse db url")
|
||||
}
|
||||
config.AfterConnect = func(ctx context.Context, conn *pgx.Conn) error {
|
||||
pgxdecimal.Register(conn.TypeMap())
|
||||
return nil
|
||||
}
|
||||
pool, err := pgxpool.NewWithConfig(context.Background(), config)
|
||||
connConfig.AfterConnect = new_es.RegisterEventstoreTypes
|
||||
pool, err := pgxpool.NewWithConfig(context.Background(), connConfig)
|
||||
if err != nil {
|
||||
logging.WithFields("error", err).Fatal("unable to create db pool")
|
||||
}
|
||||
@@ -115,15 +112,10 @@ func initDB(ctx context.Context, db *database.DB) error {
|
||||
}
|
||||
|
||||
func connectLocalhost() (*database.DB, error) {
|
||||
config, err := pgxpool.ParseConfig("postgresql://root@localhost:26257/defaultdb?sslmode=disable")
|
||||
client, err := sql.Open("pgx", "postgresql://root@localhost:26257/defaultdb?sslmode=disable")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pool, err := pgxpool.NewWithConfig(context.Background(), config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client := stdlib.OpenDBFromPool(pool)
|
||||
if err = client.Ping(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user