summaryrefslogtreecommitdiff
path: root/benchmark/postgres_test.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2026-07-31 21:39:56 +0200
committerStefan Majewsky <majewsky@gmx.net>2026-07-31 23:35:23 +0200
commit656e5dcce132716b39005814407224f989aa8c2d (patch)
treeab0a6d3a046170f0ace6a6e4ab3668ce0af811ae /benchmark/postgres_test.go
parenta2f8d7a68f324d5b4086148571f990409425e22a (diff)
downloadgo-oblast-656e5dcce132716b39005814407224f989aa8c2d.tar.gz
replace types Handle, DB, Conn, Tx with their gg/gsql equivalents
Diffstat (limited to 'benchmark/postgres_test.go')
-rw-r--r--benchmark/postgres_test.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/benchmark/postgres_test.go b/benchmark/postgres_test.go
index a5957f7..dba7ca8 100644
--- a/benchmark/postgres_test.go
+++ b/benchmark/postgres_test.go
@@ -16,6 +16,7 @@ import (
"github.com/jackc/pgx/v5"
_ "github.com/lib/pq"
"go.xyrillian.de/gg/assert"
+ "go.xyrillian.de/gg/gsql"
"go.xyrillian.de/oblast"
"go.xyrillian.de/oblast/benchmark/internal/oblast_pgx"
"go.xyrillian.de/oblast/internal/testhelpers/must"
@@ -36,9 +37,9 @@ func BenchmarkPostgresHeadingHeadingHeadingHeadingHeadingHeadingHeadingHeading(b
const defaultPostgresDSN = "host=localhost user=postgres dbname=oblast_benchmark sslmode=disable"
-func connectToPostgresTestDB(t testing.TB, recordCount int) *oblast.DB {
+func connectToPostgresTestDB(t testing.TB, recordCount int) *gsql.DB {
dsn := cmp.Or(os.Getenv("BENCHMARK_POSTGRES_DSN"), defaultPostgresDSN)
- db := oblast.NewDB(must.Return(sql.Open("postgres", dsn))(t))
+ db := gsql.NewDB(must.Return(sql.Open("postgres", dsn))(t))
_ = must.Return(db.Exec(`CREATE TEMPORARY TABLE entries (id BIGSERIAL, message TEXT)`))(t)
if recordCount > 0 {
@@ -204,7 +205,7 @@ func BenchmarkPostgresInsertAndDelete(b *testing.B) {
// test with different amounts of records
for _, batchSize := range batchSizesForInsertDelete {
b.Run("N="+strconv.Itoa(batchSize), func(b *testing.B) {
- insertAndDeleteWithOblast := func(b *testing.B, dbh oblast.Handle) {
+ insertAndDeleteWithOblast := func(b *testing.B, dbh gsql.Handle) {
records := make([]OblastEntry, batchSize)
recordsForInsert := make([]*OblastEntry, batchSize)
for idx := range records {
@@ -334,7 +335,7 @@ func BenchmarkPostgresUpdate(b *testing.B) {
}
}
- updateWithOblast := func(b *testing.B, dbh oblast.Handle, records []OblastEntry) func(string) {
+ updateWithOblast := func(b *testing.B, dbh gsql.Handle, records []OblastEntry) func(string) {
return func(message string) {
for idx := range records {
records[idx].Message = message