Skip to content

Commit

Permalink
[postgres] Add integration test (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie authored Feb 27, 2024
1 parent 753aebd commit 63506fe
Show file tree
Hide file tree
Showing 3 changed files with 606 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
.PHONY: static
static:
staticcheck ./...

.PHONY: test
test:
go test ./...

.PHONY: integration-test
itest:
go run sources/postgres/integration_test/main.go

.PHONY: race
race:
go test -race ./...
Expand Down
2 changes: 1 addition & 1 deletion lib/postgres/cast.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func castColumn(col schema.Column) string {
return fmt.Sprintf(`cast(extract(epoch from %s)*%d as bigint) as "%s"`, colName, multiplier, col.Name)
case schema.Array:
return fmt.Sprintf(`ARRAY_TO_JSON(%s)::TEXT as "%s"`, colName, col.Name)
case schema.Int16, schema.Int32, schema.Int64, schema.UUID,
case schema.Int16, schema.Int32, schema.Int64, schema.Float, schema.UUID,
schema.UserDefinedText, schema.Text,
schema.Money, schema.VariableNumeric, schema.Numeric,
schema.Boolean, schema.Bit,
Expand Down
Loading

0 comments on commit 63506fe

Please sign in to comment.