Skip to content

Commit

Permalink
try without uuid.go
Browse files Browse the repository at this point in the history
  • Loading branch information
JssDWt committed Oct 26, 2023
1 parent bcc7038 commit cc67ec4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 108 deletions.
13 changes: 2 additions & 11 deletions postgresql/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,13 @@ import (
"context"
"fmt"

"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgxpool"
)

func PgConnect(databaseUrl string) (*pgxpool.Pool, error) {
dbconfig, err := pgxpool.ParseConfig(databaseUrl)
pgxPool, err := pgxpool.New(context.Background(), databaseUrl)
if err != nil {
return nil, err
}
dbconfig.AfterConnect = func(ctx context.Context, conn *pgx.Conn) error {
RegisterUuid7(conn.TypeMap())
return nil
}
pgxPool, err := pgxpool.NewWithConfig(context.Background(), dbconfig)
if err != nil {
return nil, fmt.Errorf("pgxpool.NewWithConfig(%v): %w", databaseUrl, err)
return nil, fmt.Errorf("pgxpool.New(%v): %w", databaseUrl, err)
}
return pgxPool, nil
}
2 changes: 1 addition & 1 deletion postgresql/lsps2_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (s *Lsps2Store) GetBuyRegistration(ctx context.Context, scid lightning.Shor
WHERE r.scid = $1`,
int64(uint64(scid)),
)
var db_id uuid7.UUID
var db_id [16]byte
var db_lsp_id string
var db_peer_id string
var db_scid int64
Expand Down
96 changes: 0 additions & 96 deletions postgresql/uuid7.go

This file was deleted.

0 comments on commit cc67ec4

Please sign in to comment.