Skip to content

Commit

Permalink
fix: pg tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Sep 13, 2022
1 parent cd9de06 commit 37353fe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pkg/storage/sqlstorage/idempotency.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (s *Store) CreateIK(ctx context.Context, key string, response idempotency.R
ib := sqlbuilder.NewInsertBuilder()
q, args := ib.
InsertInto(s.schema.Table("idempotency")).
Cols("key", "date", "statusCode", "headers", "body", "requestHash").
Cols("key", "date", "status_code", "headers", "body", "request_hash").
Values(key, time.Now().UTC(), response.StatusCode, string(data), response.Body, response.RequestHash).
BuildWithFlavor(s.schema.Flavor())

Expand All @@ -37,7 +37,7 @@ func (s *Store) CreateIK(ctx context.Context, key string, response idempotency.R
func (s *Store) ReadIK(ctx context.Context, key string) (*idempotency.Response, error) {
sb := sqlbuilder.NewSelectBuilder()
q, args := sb.
Select("statusCode", "headers", "body", "requestHash").
Select("status_code", "headers", "body", "request_hash").
From(s.schema.Table("idempotency")).
Where(sb.Equal("key", key)).
BuildWithFlavor(s.schema.Flavor())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--statement
CREATE TABLE IF NOT EXISTS "VAR_LEDGER_NAME"."idempotency" (
CREATE TABLE IF NOT EXISTS "VAR_LEDGER_NAME".idempotency (
"key" varchar,
"date" varchar,
"statusCode" int,
"status_code" int,
"headers" varchar,
"body" varchar,
"requestHash" varchar,
"request_hash" varchar,

PRIMARY KEY("key")
);
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
CREATE TABLE IF NOT EXISTS idempotency (
"key" varchar,
"date" varchar,
"statusCode" int,
"status_code" int,
"headers" varchar,
"body" varchar,
"requestHash" varchar,
"request_hash" varchar,

PRIMARY KEY("key")
);

0 comments on commit 37353fe

Please sign in to comment.