Repository: GoogleCloudPlatform/pgadapter
Pull request #3170 (2025-04-14 17:15:12)

chore: only use original SQL statement with comments
PGAdapter should not use the SQL string that has been stripped for comments anywhere, as the built-in parser is able to handle comments in the SQL string. The getSqlWithoutComments() method in the Java client library will eventually be deprecated, which will remove some additional string parsing and creation for each statement that is executed.


Patch:
diff --git a/benchmarks/latency-comparison/golang/go.mod b/benchmarks/latency-comparison/golang/go.mod
index c8fa8048..76bdac19 100644
--- a/benchmarks/latency-comparison/golang/go.mod
+++ b/benchmarks/latency-comparison/golang/go.mod
@@ -12,11 +12,11 @@ require (
 	github.com/montanaflynn/stats v0.7.0
 	github.com/testcontainers/testcontainers-go v0.36.0
 	golang.org/x/oauth2 v0.29.0
-	google.golang.org/api v0.229.0
+	google.golang.org/api v0.230.0
 )
 
 require (
-	cel.dev/expr v0.19.2 // indirect
+	cel.dev/expr v0.20.0 // indirect
 	cloud.google.com/go v0.120.0 // indirect
 	cloud.google.com/go/auth v0.16.0 // indirect
 	cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
@@ -42,6 +42,7 @@ require (
 	github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
 	github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
 	github.com/felixge/httpsnoop v1.0.4 // indirect
+	github.com/go-jose/go-jose/v4 v4.0.4 // indirect
 	github.com/go-logr/logr v1.4.2 // indirect
 	github.com/go-logr/stdr v1.2.2 // indirect
 	github.com/go-ole/go-ole v1.2.6 // indirect
@@ -79,10 +80,12 @@ require (
 	github.com/shirou/gopsutil/v4 v4.25.1 // indirect
 	github.com/shoenig/go-m1cpu v0.1.6 // indirect
 	github.com/sirupsen/logrus v1.9.3 // indirect
+	github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect
 	github.com/stretchr/testify v1.10.0 // indirect
 	github.com/tklauser/go-sysconf v0.3.12 // indirect
 	github.com/tklauser/numcpus v0.6.1 // indirect
 	github.com/yusufpapurcu/wmi v1.2.4 // indirect
+	github.com/zeebo/errs v1.4.0 // indirect
 	go.opencensus.io v0.24.0 // indirect
 	go.opentelemetry.io/auto/sdk v1.1.0 // indirect
 	go.opentelemetry.io/contrib/detectors/gcp v1.35.0 // indirect
@@ -103,7 +106,7 @@ require (
 	google.golang.org/genproto v0.0.0-20250303144028-a0af3efb3deb // indirect
 	google.golang.org/genproto/googleapis/api v0.0.0-20250313205543-e70fdf4c4cb4 // indirect
 	google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e // indirect
-	google.golang.org/grpc v1.71.1 // indirect
+	google.golang.org/grpc v1.72.0 // indirect
 	google.golang.org/protobuf v1.36.6 // indirect
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 )
diff --git a/benchmarks/latency-comparison/golang/go.sum b/benchmarks/latency-comparison/golang/go.sum
index e49c537b..14296ab3 100644
--- a/benchmarks/latency-comparison/golang/go.sum
+++ b/benchmarks/latency-comparison/golang/go.sum
@@ -2,6 +2,8 @@ cel.dev/expr v0.19.1 h1:NciYrtDRIR0lNCnH1LFJegdjspNx9fI59O7TWcua/W4=
 cel.dev/expr v0.19.1/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw=
 cel.dev/expr v0.19.2 h1:V354PbqIXr9IQdwy4SYA4xa0HXaWq1BUPAGzugBY5V4=
 cel.dev/expr v0.19.2/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw=
+cel.dev/expr v0.20.0 h1:OunBvVCfvpWlt4dN7zg3FM6TDkzOePe1+foGJ9AXeeI=
+cel.dev/expr v0.20.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw=
 cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
@@ -763,6 +765,8 @@ github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmn
 github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
+github.com/go-jose/go-jose/v4 v4.0.4 h1:VsjPI33J0SB9vQM6PLmNjoHqMQNGPiZ0rHL7Ni7Q6/E=
+github.com/go-jose/go-jose/v4 v4.0.4/go.mod h1:NKb5HO1EZccyMpiZNbdUw/14tiXNyUJh188dfnMCAfc=
 github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
 github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U=
 github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk=
@@ -1092,6 +1096,8 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO
 github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4=
 github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
 github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
+github.com/spiffe/go-spiffe/v2 v2.5.0 h1:N2I01KCUkv1FAjZXJMwh95KK1ZIQLYbPfhaxw8WS0hE=
+github.com/spiffe/go-spiffe/v2 v2.5.0/go.mod h1:P+NxobPc6wXhVtINNtFjNWGBTreew1GBUCwT2wPmb7g=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
@@ -1132,6 +1138,8 @@ github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQ
 github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
 github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
 github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
+github.com/zeebo/errs v1.4.0 h1:XNdoD/RRMKP7HD0UhJnIzUy74ISdGGxURlYG8HSWSfM=
+github.com/zeebo/errs v1.4.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4=
 github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
 github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
 go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
@@ -1669,6 +1677,8 @@ google.golang.org/api v0.228.0 h1:X2DJ/uoWGnY5obVjewbp8icSL5U4FzuCfy9OjbLSnLs=
 google.golang.org/api v0.228.0/go.mod h1:wNvRS1Pbe8r4+IfBIniV8fwCpGwTrYa+kMUDiC5z5a4=
 google.golang.org/api v0.229.0 h1:p98ymMtqeJ5i3lIBMj5MpR9kzIIgzpHHh8vQ+vgAzx8=
 google.golang.org/api v0.229.0/go.mod h1:wyDfmq5g1wYJWn29O22FDWN48P7Xcz0xz+LBpptYvB0=
+google.golang.org/api v0.230.0 h1:2u1hni3E+UXAXrONrrkfWpi/V6cyKVAbfGVeGtC3OxM=
+google.golang.org/api v0.230.0/go.mod h1:aqvtoMk7YkiXx+6U12arQFExiRV9D/ekvMCwCd/TksQ=
 google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
 google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@@ -1867,6 +1877,8 @@ google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg=
 google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
 google.golang.org/grpc v1.71.1 h1:ffsFWr7ygTUscGPI0KKK6TLrGz0476KUvvsbqWK0rPI=
 google.golang.org/grpc v1.71.1/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
+google.golang.org/grpc v1.72.0 h1:S7UkcVa60b5AAQTaO6ZKamFp1zMZSU0fGDK2WZLbBnM=
+google.golang.org/grpc v1.72.0/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM=
 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
 google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
 google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
diff --git a/samples/golang/gorm/go.mod b/samples/golang/gorm/go.mod
index 90ddc7a3..895722fb 100644
--- a/samples/golang/gorm/go.mod
+++ b/samples/golang/gorm/go.mod
@@ -5,7 +5,7 @@ go 1.23.0
 toolchain go1.24.2
 
 require (
-	github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250323074852-37f29d31de31
+	github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250421200519-995984e20ed5
 	github.com/google/uuid v1.6.0
 	github.com/jackc/pgtype v1.14.4
 	github.com/shopspring/decimal v1.4.0
@@ -28,7 +28,7 @@ require (
 	github.com/cpuguy83/dockercfg v0.3.2 // indirect
 	github.com/davecgh/go-spew v1.1.1 // indirect
 	github.com/distribution/reference v0.6.0 // indirect
-	github.com/docker/docker v28.0.2+incompatible // indirect
+	github.com/docker/docker v28.1.1+incompatible // indirect
 	github.com/docker/go-connections v0.5.0 // indirect
 	github.com/docker/go-units v0.5.0 // indirect
 	github.com/ebitengine/purego v0.8.2 // indirect
@@ -46,13 +46,14 @@ require (
 	github.com/jackc/puddle/v2 v2.2.1 // indirect
 	github.com/jinzhu/inflection v1.0.0 // indirect
 	github.com/jinzhu/now v1.1.5 // indirect
-	github.com/klauspost/compress v1.17.4 // indirect
+	github.com/klauspost/compress v1.18.0 // indirect
 	github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed // indirect
 	github.com/magiconair/properties v1.8.9 // indirect
 	github.com/moby/docker-image-spec v1.3.1 // indirect
+	github.com/moby/go-archive v0.1.0 // indirect
 	github.com/moby/patternmatcher v0.6.0 // indirect
-	github.com/moby/sys/sequential v0.5.0 // indirect
-	github.com/moby/sys/user v0.1.0 // indirect
+	github.com/moby/sys/sequential v0.6.0 // indirect
+	github.com/moby/sys/user v0.4.0 // indirect
 	github.com/moby/sys/userns v0.1.0 // indirect
 	github.com/moby/term v0.5.0 // indirect
 	github.com/morikuni/aec v1.0.0 // indirect
@@ -73,7 +74,7 @@ require (
 	go.opentelemetry.io/otel/metric v1.35.0 // indirect
 	go.opentelemetry.io/otel/trace v1.35.0 // indirect
 	golang.org/x/crypto v0.35.0 // indirect
-	golang.org/x/oauth2 v0.28.0 // indirect
+	golang.org/x/oauth2 v0.29.0 // indirect
 	golang.org/x/sync v0.11.0 // indirect
 	golang.org/x/sys v0.31.0 // indirect
 	golang.org/x/text v0.22.0 // indirect
diff --git a/samples/golang/gorm/go.sum b/samples/golang/gorm/go.sum
index 343b76c3..d215827d 100644
--- a/samples/golang/gorm/go.sum
+++ b/samples/golang/gorm/go.sum
@@ -11,6 +11,8 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg6
 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
 github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250323074852-37f29d31de31 h1:6q6qycad5asywXYe3AdjW+e3g1jUGnFErG5cz7rMa2o=
 github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250323074852-37f29d31de31/go.mod h1:gftYKzJ77HNIvrtg4FcQ48/utvFL0yurXCOvttewtd0=
+github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250421200519-995984e20ed5 h1:ZF+trXn7T5E1mCFC1LtpAqHAxAjJwI6dl6GALd6Mrls=
+github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250421200519-995984e20ed5/go.mod h1:iaJnGXaveEW8Nd14+NQwwaDTvgg1VBpOuQndCd/ueac=
 github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
 github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
 github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
@@ -35,6 +37,8 @@ github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5Qvfr
 github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
 github.com/docker/docker v28.0.2+incompatible h1:9BILleFwug5FSSqWBgVevgL3ewDJfWWWyZVqlDMttE8=
 github.com/docker/docker v28.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
+github.com/docker/docker v28.1.1+incompatible h1:49M11BFLsVO1gxY9UX9p/zwkE/rswggs8AdFmXQw51I=
+github.com/docker/docker v28.1.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
 github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
 github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
 github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
@@ -135,6 +139,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI
 github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
 github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
 github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
+github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
+github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
 github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
 github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
 github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
@@ -168,12 +174,18 @@ github.com/microsoft/go-mssqldb v1.7.2 h1:CHkFJiObW7ItKTJfHo1QX7QBBD1iV+mn1eOyRP
 github.com/microsoft/go-mssqldb v1.7.2/go.mod h1:kOvZKUdrhhFQmxLZqbwUV0rHkNkZpthMITIb2Ko1IoA=
 github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
 github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
+github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ=
+github.com/moby/go-archive v0.1.0/go.mod h1:G9B+YoujNohJmrIYFBpSd54GTUB4lt9S+xVQvsJyFuo=
 github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
 github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
 github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
 github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
+github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU=
+github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko=
 github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
 github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU=
+github.com/moby/sys/user v0.4.0 h1:jhcMKit7SA80hivmFJcbB1vqmw//wU61Zdui2eQXuMs=
+github.com/moby/sys/user v0.4.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs=
 github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g=
 github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28=
 github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
@@ -304,6 +316,8 @@ golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA=
 golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I=
 golang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc=
 golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
+golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98=
+golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
 golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
diff --git a/samples/golang/migrate/go.mod b/samples/golang/migrate/go.mod
index d4367926..05ec4712 100644
--- a/samples/golang/migrate/go.mod
+++ b/samples/golang/migrate/go.mod
@@ -5,13 +5,13 @@ go 1.23.0
 toolchain go1.24.2
 
 require (
-	github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250323074852-37f29d31de31
+	github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250421200519-995984e20ed5
 	github.com/golang-migrate/migrate/v4 v4.18.2
 )
 
 require (
 	cloud.google.com/go/compute/metadata v0.3.0 // indirect
-	dario.cat/mergo v1.0.0 // indirect
+	dario.cat/mergo v1.0.1 // indirect
 	github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
 	github.com/Microsoft/go-winio v0.6.2 // indirect
 	github.com/cenkalti/backoff/v4 v4.2.1 // indirect
@@ -20,9 +20,10 @@ require (
 	github.com/cpuguy83/dockercfg v0.3.2 // indirect
 	github.com/davecgh/go-spew v1.1.1 // indirect
 	github.com/distribution/reference v0.6.0 // indirect
-	github.com/docker/docker v28.0.2+incompatible // indirect
+	github.com/docker/docker v28.1.1+incompatible // indirect
 	github.com/docker/go-connections v0.5.0 // indirect
 	github.com/docker/go-units v0.5.0 // indirect
+	github.com/ebitengine/purego v0.8.2 // indirect
 	github.com/felixge/httpsnoop v1.0.4 // indirect
 	github.com/go-logr/logr v1.4.2 // indirect
 	github.com/go-logr/stdr v1.2.2 // indirect
@@ -32,31 +33,33 @@ require (
 	github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
 	github.com/hashicorp/errwrap v1.1.0 // indirect
 	github.com/hashicorp/go-multierror v1.1.1 // indirect
-	github.com/klauspost/compress v1.17.4 // indirect
+	github.com/klauspost/compress v1.18.0 // indirect
 	github.com/kr/pretty v0.3.1 // indirect
 	github.com/lib/pq v1.10.9 // indirect
 	github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
-	github.com/magiconair/properties v1.8.7 // indirect
+	github.com/magiconair/properties v1.8.9 // indirect
 	github.com/moby/docker-image-spec v1.3.1 // indirect
+	github.com/moby/go-archive v0.1.0 // indirect
 	github.com/moby/patternmatcher v0.6.0 // indirect
-	github.com/moby/sys/sequential v0.5.0 // indirect
-	github.com/moby/sys/user v0.1.0 // indirect
+	github.com/moby/sys/sequential v0.6.0 // indirect
+	github.com/moby/sys/user v0.4.0 // indirect
 	github.com/moby/sys/userns v0.1.0 // indirect
 	github.com/moby/term v0.5.0 // indirect
 	github.com/morikuni/aec v1.0.0 // indirect
 	github.com/opencontainers/go-digest v1.0.0 // indirect
-	github.com/opencontainers/image-spec v1.1.0 // indirect
+	github.com/opencontainers/image-spec v1.1.1 // indirect
 	github.com/pkg/errors v0.9.1 // indirect
 	github.com/pmezard/go-difflib v1.0.0 // indirect
 	github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
 	github.com/shirou/gopsutil/v3 v3.23.12 // indirect
+	github.com/shirou/gopsutil/v4 v4.25.1 // indirect
 	github.com/shoenig/go-m1cpu v0.1.6 // indirect
 	github.com/sirupsen/logrus v1.9.3 // indirect
 	github.com/stretchr/testify v1.10.0 // indirect
-	github.com/testcontainers/testcontainers-go v0.35.0 // indirect
+	github.com/testcontainers/testcontainers-go v0.36.0 // indirect
 	github.com/tklauser/go-sysconf v0.3.12 // indirect
 	github.com/tklauser/numcpus v0.6.1 // indirect
-	github.com/yusufpapurcu/wmi v1.2.3 // indirect
+	github.com/yusufpapurcu/wmi v1.2.4 // indirect
 	go.opentelemetry.io/auto/sdk v1.1.0 // indirect
 	go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
 	go.opentelemetry.io/otel v1.35.0 // indirect
@@ -64,7 +67,7 @@ require (
 	go.opentelemetry.io/otel/trace v1.35.0 // indirect
 	go.uber.org/atomic v1.7.0 // indirect
 	golang.org/x/crypto v0.35.0 // indirect
-	golang.org/x/oauth2 v0.28.0 // indirect
-	golang.org/x/sys v0.30.0 // indirect
+	golang.org/x/oauth2 v0.29.0 // indirect
+	golang.org/x/sys v0.31.0 // indirect
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 )
diff --git a/samples/golang/migrate/go.sum b/samples/golang/migrate/go.sum
index 6374dcb9..538e048d 100644
--- a/samples/golang/migrate/go.sum
+++ b/samples/golang/migrate/go.sum
@@ -2,6 +2,8 @@ cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2Qx
 cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
 dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
 dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
+dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
+dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
 github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU=
 github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
@@ -30,6 +32,8 @@ github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250321111813-3
 github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250321111813-3a98e62af709/go.mod h1:gftYKzJ77HNIvrtg4FcQ48/utvFL0yurXCOvttewtd0=
 github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250323074852-37f29d31de31 h1:6q6qycad5asywXYe3AdjW+e3g1jUGnFErG5cz7rMa2o=
 github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250323074852-37f29d31de31/go.mod h1:gftYKzJ77HNIvrtg4FcQ48/utvFL0yurXCOvttewtd0=
+github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250421200519-995984e20ed5 h1:ZF+trXn7T5E1mCFC1LtpAqHAxAjJwI6dl6GALd6Mrls=
+github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250421200519-995984e20ed5/go.mod h1:iaJnGXaveEW8Nd14+NQwwaDTvgg1VBpOuQndCd/ueac=
 github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
 github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
 github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
@@ -60,10 +64,14 @@ github.com/docker/docker v28.0.1+incompatible h1:FCHjSRdXhNRFjlHMTv4jUNlIBbTeRjr
 github.com/docker/docker v28.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
 github.com/docker/docker v28.0.2+incompatible h1:9BILleFwug5FSSqWBgVevgL3ewDJfWWWyZVqlDMttE8=
 github.com/docker/docker v28.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
+github.com/docker/docker v28.1.1+incompatible h1:49M11BFLsVO1gxY9UX9p/zwkE/rswggs8AdFmXQw51I=
+github.com/docker/docker v28.1.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
 github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
 github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
 github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
+github.com/ebitengine/purego v0.8.2 h1:jPPGWs2sZ1UgOSgD2bClL0MJIqu58nOmIcBuXr62z1I=
+github.com/ebitengine/purego v0.8.2/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
 github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
 github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
 github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
@@ -96,6 +104,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI
 github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
 github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
 github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
+github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
+github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
 github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
 github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
 github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@@ -106,14 +116,22 @@ github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ
 github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
 github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
 github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
+github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM=
+github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
 github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
 github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
+github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ=
+github.com/moby/go-archive v0.1.0/go.mod h1:G9B+YoujNohJmrIYFBpSd54GTUB4lt9S+xVQvsJyFuo=
 github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
 github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
 github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
 github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
+github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU=
+github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko=
 github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
 github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU=
+github.com/moby/sys/user v0.4.0 h1:jhcMKit7SA80hivmFJcbB1vqmw//wU61Zdui2eQXuMs=
+github.com/moby/sys/user v0.4.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs=
 github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g=
 github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28=
 github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
@@ -124,6 +142,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
 github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
 github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=
+github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
+github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
 github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
 github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
 github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -136,6 +156,8 @@ github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU
 github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
 github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4=
 github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM=
+github.com/shirou/gopsutil/v4 v4.25.1 h1:QSWkTc+fu9LTAWfkZwZ6j8MSUk4A2LV7rbH0ZqmLjXs=
+github.com/shirou/gopsutil/v4 v4.25.1/go.mod h1:RoUCUpndaJFtT+2zsZzzmhvbfGoDCJ7nFXKJf8GqJbI=
 github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
 github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
 github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
@@ -160,6 +182,8 @@ github.com/testcontainers/testcontainers-go v0.34.0 h1:5fbgF0vIN5u+nD3IWabQwRybu
 github.com/testcontainers/testcontainers-go v0.34.0/go.mod h1:6P/kMkQe8yqPHfPWNulFGdFHTD8HB2vLq/231xY2iPQ=
 github.com/testcontainers/testcontainers-go v0.35.0 h1:uADsZpTKFAtp8SLK+hMwSaa+X+JiERHtd4sQAFmXeMo=
 github.com/testcontainers/testcontainers-go v0.35.0/go.mod h1:oEVBj5zrfJTrgjwONs1SsRbnBtH9OKl+IGl3UMcr2B4=
+github.com/testcontainers/testcontainers-go v0.36.0 h1:YpffyLuHtdp5EUsI5mT4sRw8GZhO/5ozyDT1xWGXt00=
+github.com/testcontainers/testcontainers-go v0.36.0/go.mod h1:yk73GVJ0KUZIHUtFna6MO7QS144qYpoY8lEEtU9Hed0=
 github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
 github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
 github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
@@ -168,6 +192,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
 github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=
 github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
+github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
+github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
 go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
 go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk=
@@ -219,6 +245,8 @@ golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M=
 golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
 golang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc=
 golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
+golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98=
+golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
 golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -236,6 +264,8 @@ golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
 golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
 golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
 golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
+golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
 golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
 golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
diff --git a/samples/golang/pgx/go.mod b/samples/golang/pgx/go.mod
index d7a454ee..ea0a0736 100644
--- a/samples/golang/pgx/go.mod
+++ b/samples/golang/pgx/go.mod
@@ -5,13 +5,13 @@ go 1.23.0
 toolchain go1.24.2
 
 require (
-	github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250323074852-37f29d31de31
+	github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250421200519-995984e20ed5
 	github.com/jackc/pgx/v5 v5.7.4
 )
 
 require (
 	cloud.google.com/go/compute/metadata v0.3.0 // indirect
-	dario.cat/mergo v1.0.0 // indirect
+	dario.cat/mergo v1.0.1 // indirect
 	github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
 	github.com/Microsoft/go-winio v0.6.2 // indirect
 	github.com/cenkalti/backoff/v4 v4.2.1 // indirect
@@ -20,9 +20,10 @@ require (
 	github.com/cpuguy83/dockercfg v0.3.2 // indirect
 	github.com/davecgh/go-spew v1.1.1 // indirect
 	github.com/distribution/reference v0.6.0 // indirect
-	github.com/docker/docker v28.0.2+incompatible // indirect
+	github.com/docker/docker v28.1.1+incompatible // indirect
 	github.com/docker/go-connections v0.5.0 // indirect
 	github.com/docker/go-units v0.5.0 // indirect
+	github.com/ebitengine/purego v0.8.2 // indirect
 	github.com/felixge/httpsnoop v1.0.4 // indirect
 	github.com/go-logr/logr v1.4.2 // indirect
 	github.com/go-logr/stdr v1.2.2 // indirect
@@ -31,31 +32,33 @@ require (
 	github.com/google/uuid v1.6.0 // indirect
 	github.com/jackc/pgpassfile v1.0.0 // indirect
 	github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
-	github.com/klauspost/compress v1.17.4 // indirect
+	github.com/klauspost/compress v1.18.0 // indirect
 	github.com/kr/pretty v0.3.1 // indirect
 	github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
-	github.com/magiconair/properties v1.8.7 // indirect
+	github.com/magiconair/properties v1.8.9 // indirect
 	github.com/moby/docker-image-spec v1.3.1 // indirect
+	github.com/moby/go-archive v0.1.0 // indirect
 	github.com/moby/patternmatcher v0.6.0 // indirect
-	github.com/moby/sys/sequential v0.5.0 // indirect
-	github.com/moby/sys/user v0.1.0 // indirect
+	github.com/moby/sys/sequential v0.6.0 // indirect
+	github.com/moby/sys/user v0.4.0 // indirect
 	github.com/moby/sys/userns v0.1.0 // indirect
 	github.com/moby/term v0.5.0 // indirect
 	github.com/morikuni/aec v1.0.0 // indirect
 	github.com/opencontainers/go-digest v1.0.0 // indirect
-	github.com/opencontainers/image-spec v1.1.0 // indirect
+	github.com/opencontainers/image-spec v1.1.1 // indirect
 	github.com/pkg/errors v0.9.1 // indirect
 	github.com/pmezard/go-difflib v1.0.0 // indirect
 	github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
 	github.com/rogpeppe/go-internal v1.13.1 // indirect
 	github.com/shirou/gopsutil/v3 v3.23.12 // indirect
+	github.com/shirou/gopsutil/v4 v4.25.1 // indirect
 	github.com/shoenig/go-m1cpu v0.1.6 // indirect
 	github.com/sirupsen/logrus v1.9.3 // indirect
 	github.com/stretchr/testify v1.10.0 // indirect
-	github.com/testcontainers/testcontainers-go v0.35.0 // indirect
+	github.com/testcontainers/testcontainers-go v0.36.0 // indirect
 	github.com/tklauser/go-sysconf v0.3.12 // indirect
 	github.com/tklauser/numcpus v0.6.1 // indirect
-	github.com/yusufpapurcu/wmi v1.2.3 // indirect
+	github.com/yusufpapurcu/wmi v1.2.4 // indirect
 	go.opentelemetry.io/auto/sdk v1.1.0 // indirect
 	go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
 	go.opentelemetry.io/otel v1.35.0 // indirect
@@ -64,8 +67,8 @@ require (
 	go.opentelemetry.io/otel/trace v1.35.0 // indirect
 	go.opentelemetry.io/proto/otlp v1.0.0 // indirect
 	golang.org/x/crypto v0.35.0 // indirect
-	golang.org/x/oauth2 v0.28.0 // indirect
-	golang.org/x/sys v0.30.0 // indirect
+	golang.org/x/oauth2 v0.29.0 // indirect
+	golang.org/x/sys v0.31.0 // indirect
 	golang.org/x/text v0.22.0 // indirect
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 )
diff --git a/samples/golang/pgx/go.sum b/samples/golang/pgx/go.sum
index fd89e18f..5db32934 100644
--- a/samples/golang/pgx/go.sum
+++ b/samples/golang/pgx/go.sum
@@ -2,6 +2,8 @@ cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2Qx
 cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
 dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
 dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
+dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
+dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
 github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU=
 github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
 github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
@@ -32,6 +34,8 @@ github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250321111813-3
 github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250321111813-3a98e62af709/go.mod h1:gftYKzJ77HNIvrtg4FcQ48/utvFL0yurXCOvttewtd0=
 github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250323074852-37f29d31de31 h1:6q6qycad5asywXYe3AdjW+e3g1jUGnFErG5cz7rMa2o=
 github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250323074852-37f29d31de31/go.mod h1:gftYKzJ77HNIvrtg4FcQ48/utvFL0yurXCOvttewtd0=
+github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250421200519-995984e20ed5 h1:ZF+trXn7T5E1mCFC1LtpAqHAxAjJwI6dl6GALd6Mrls=
+github.com/GoogleCloudPlatform/pgadapter/wrappers/golang v0.0.0-20250421200519-995984e20ed5/go.mod h1:iaJnGXaveEW8Nd14+NQwwaDTvgg1VBpOuQndCd/ueac=
 github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
 github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
 github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
@@ -62,10 +66,14 @@ github.com/docker/docker v28.0.1+incompatible h1:FCHjSRdXhNRFjlHMTv4jUNlIBbTeRjr
 github.com/docker/docker v28.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
 github.com/docker/docker v28.0.2+incompatible h1:9BILleFwug5FSSqWBgVevgL3ewDJfWWWyZVqlDMttE8=
 github.com/docker/docker v28.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
+github.com/docker/docker v28.1.1+incompatible h1:49M11BFLsVO1gxY9UX9p/zwkE/rswggs8AdFmXQw51I=
+github.com/docker/docker v28.1.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
 github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
 github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
 github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
+github.com/ebitengine/purego v0.8.2 h1:jPPGWs2sZ1UgOSgD2bClL0MJIqu58nOmIcBuXr62z1I=
+github.com/ebitengine/purego v0.8.2/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
 github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
 github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
 github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
@@ -105,6 +113,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI
 github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
 github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
 github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
+github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
+github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
 github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
 github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
 github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@@ -113,14 +123,22 @@ github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ
 github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
 github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
 github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
+github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM=
+github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
 github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
 github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
+github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ=
+github.com/moby/go-archive v0.1.0/go.mod h1:G9B+YoujNohJmrIYFBpSd54GTUB4lt9S+xVQvsJyFuo=
 github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
 github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
 github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
 github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
+github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU=
+github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko=
 github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
 github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU=
+github.com/moby/sys/user v0.4.0 h1:jhcMKit7SA80hivmFJcbB1vqmw//wU61Zdui2eQXuMs=
+github.com/moby/sys/user v0.4.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs=
 github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g=
 github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28=
 github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
@@ -131,6 +149,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
 github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
 github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=
+github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
+github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
 github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
 github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
 github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -144,6 +164,8 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj
 github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
 github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4=
 github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM=
+github.com/shirou/gopsutil/v4 v4.25.1 h1:QSWkTc+fu9LTAWfkZwZ6j8MSUk4A2LV7rbH0ZqmLjXs=
+github.com/shirou/gopsutil/v4 v4.25.1/go.mod h1:RoUCUpndaJFtT+2zsZzzmhvbfGoDCJ7nFXKJf8GqJbI=
 github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
 github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
 github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
@@ -168,6 +190,8 @@ github.com/testcontainers/testcontainers-go v0.34.0 h1:5fbgF0vIN5u+nD3IWabQwRybu
 github.com/testcontainers/testcontainers-go v0.34.0/go.mod h1:6P/kMkQe8yqPHfPWNulFGdFHTD8HB2vLq/231xY2iPQ=
 github.com/testcontainers/testcontainers-go v0.35.0 h1:uADsZpTKFAtp8SLK+hMwSaa+X+JiERHtd4sQAFmXeMo=
 github.com/testcontainers/testcontainers-go v0.35.0/go.mod h1:oEVBj5zrfJTrgjwONs1SsRbnBtH9OKl+IGl3UMcr2B4=
+github.com/testcontainers/testcontainers-go v0.36.0 h1:YpffyLuHtdp5EUsI5mT4sRw8GZhO/5ozyDT1xWGXt00=
+github.com/testcontainers/testcontainers-go v0.36.0/go.mod h1:yk73GVJ0KUZIHUtFna6MO7QS144qYpoY8lEEtU9Hed0=
 github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
 github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
 github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
@@ -176,6 +200,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
 github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=
 github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
+github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
+github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
 go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
 go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=
@@ -227,6 +253,8 @@ golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M=
 golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
 golang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc=
 golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
+golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98=
+golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
 golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -246,6 +274,8 @@ golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
 golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
 golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
 golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
+golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
 golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
 golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/ArrayParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/ArrayParser.java
index 6e68b59c..7135d4a0 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/ArrayParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/ArrayParser.java
@@ -20,7 +20,6 @@ import com.google.cloud.Timestamp;
 import com.google.cloud.spanner.ErrorCode;
 import com.google.cloud.spanner.ResultSet;
 import com.google.cloud.spanner.SpannerExceptionFactory;
-import com.google.cloud.spanner.Statement;
 import com.google.cloud.spanner.Type;
 import com.google.cloud.spanner.Type.Code;
 import com.google.cloud.spanner.Value;
@@ -30,6 +29,7 @@ import com.google.cloud.spanner.pgadapter.error.SQLState;
 import com.google.cloud.spanner.pgadapter.session.SessionState;
 import com.google.cloud.spanner.pgadapter.statements.SimpleParser;
 import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.DataInputStream;
@@ -343,70 +343,70 @@ public class ArrayParser extends Parser<List<?>> {
 
   @SuppressWarnings("unchecked")
   @Override
-  public void bind(Statement.Builder statementBuilder, String name) {
+  public void bind(ImmutableMap.Builder<String, Value> parametersBuilder, String name) {
     switch (elementOid) {
       case Oid.BIT:
       case Oid.BOOL:
-        statementBuilder.bind(name).toBoolArray((List<Boolean>) this.item);
+        parametersBuilder.put(name, Value.boolArray((List<Boolean>) this.item));
         break;
       case Oid.INT2:
         if (this.item == null) {
-          statementBuilder.bind(name).toInt64Array((long[]) null);
+          parametersBuilder.put(name, Value.int64Array((long[]) null));
         } else {
-          statementBuilder
-              .bind(name)
-              .toInt64Array(
+          parametersBuilder.put(
+              name,
+              Value.int64Array(
                   ((List<Short>) this.item)
                       .stream()
                           .map(s -> s == null ? null : s.longValue())
-                          .collect(Collectors.toList()));
+                          .collect(Collectors.toList())));
         }
         break;
       case Oid.INT4:
         if (this.item == null) {
-          statementBuilder.bind(name).toInt64Array((long[]) null);
+          parametersBuilder.put(name, Value.int64Array((long[]) null));
         } else {
-          statementBuilder
-              .bind(name)
-              .toInt64Array(
+          parametersBuilder.put(
+              name,
+              Value.int64Array(
                   ((List<Integer>) this.item)
                       .stream()
                           .map(i -> i == null ? null : i.longValue())
-                          .collect(Collectors.toList()));
+                          .collect(Collectors.toList())));
         }
         break;
       case Oid.INT8:
-        statementBuilder.bind(name).toInt64Array((List<Long>) this.item);
+        parametersBuilder.put(name, Value.int64Array((List<Long>) this.item));
         break;
       case Oid.OID:
-        statementBuilder.bind(name).toPgOidArray((List<Long>) this.item);
+        parametersBuilder.put(name, Value.pgOidArray((List<Long>) this.item));
         break;
       case Oid.NUMERIC:
-        statementBuilder.bind(name).toPgNumericArray((List<String>) this.item);
+        parametersBuilder.put(name, Value.pgNumericArray((List<String>) this.item));
         break;
       case Oid.FLOAT4:
-        statementBuilder.bind(name).toFloat32Array((List<Float>) this.item);
+        parametersBuilder.put(name, Value.float32Array((List<Float>) this.item));
         break;
       case Oid.FLOAT8:
-        statementBuilder.bind(name).toFloat64Array((List<Double>) this.item);
+        parametersBuilder.put(name, Value.float64Array((List<Double>) this.item));
         break;
       case Oid.UUID:
       case Oid.VARCHAR:
       case Oid.TEXT:
-        statementBuilder.bind(name).toStringArray((List<String>) this.item);
+        parametersBuilder.put(name, Value.stringArray((List<String>) this.item));
         break;
       case Oid.JSONB:
-        statementBuilder.bind(name).toPgJsonbArray((List<String>) this.item);
+        parametersBuilder.put(name, Value.pgJsonbArray((List<String>) this.item));
         break;
       case Oid.BYTEA:
-        statementBuilder.bind(name).toBytesArray((List<ByteArray>) this.item);
+        parametersBuilder.put(name, Value.bytesArray((List<ByteArray>) this.item));
         break;
       case Oid.TIMESTAMPTZ:
       case Oid.TIMESTAMP:
-        statementBuilder.bind(name).toTimestampArray((List<Timestamp>) this.item);
+        parametersBuilder.put(name, Value.timestampArray((List<Timestamp>) this.item));
         break;
       case Oid.DATE:
-        statementBuilder.bind(name).toDateArray((List<Date>) this.item);
+        parametersBuilder.put(name, Value.dateArray((List<Date>) this.item));
         break;
       default:
         throw PGExceptionFactory.newPGException(
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/BinaryParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/BinaryParser.java
index 085319b4..99645ae5 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/BinaryParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/BinaryParser.java
@@ -19,10 +19,11 @@ import com.google.cloud.ByteArray;
 import com.google.cloud.spanner.ProtobufResultSet;
 import com.google.cloud.spanner.ResultSet;
 import com.google.cloud.spanner.SpannerExceptionFactory;
-import com.google.cloud.spanner.Statement;
+import com.google.cloud.spanner.Value;
 import com.google.cloud.spanner.pgadapter.ProxyServer.DataFormat;
 import com.google.cloud.spanner.pgadapter.error.PGExceptionFactory;
 import com.google.cloud.spanner.pgadapter.session.SessionState;
+import com.google.common.collect.ImmutableMap;
 import com.google.common.io.CharSource;
 import java.io.DataOutputStream;
 import java.io.IOException;
@@ -180,7 +181,7 @@ public class BinaryParser extends Parser<ByteArray> {
   }
 
   @Override
-  public void bind(Statement.Builder statementBuilder, String name) {
-    statementBuilder.bind(name).to(this.item);
+  public void bind(ImmutableMap.Builder<String, Value> parametersBuilder, String name) {
+    parametersBuilder.put(name, Value.bytes(this.item));
   }
 }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/BooleanParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/BooleanParser.java
index ef766f49..8cf9ea85 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/BooleanParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/BooleanParser.java
@@ -18,9 +18,10 @@ import com.google.api.core.InternalApi;
 import com.google.cloud.spanner.ErrorCode;
 import com.google.cloud.spanner.ResultSet;
 import com.google.cloud.spanner.SpannerExceptionFactory;
-import com.google.cloud.spanner.Statement;
+import com.google.cloud.spanner.Value;
 import com.google.cloud.spanner.pgadapter.ProxyServer.DataFormat;
 import com.google.cloud.spanner.pgadapter.error.PGExceptionFactory;
+import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 import java.nio.charset.StandardCharsets;
 import java.util.Locale;
@@ -138,7 +139,7 @@ public class BooleanParser extends Parser<Boolean> {
   }
 
   @Override
-  public void bind(Statement.Builder statementBuilder, String name) {
-    statementBuilder.bind(name).to(this.item);
+  public void bind(ImmutableMap.Builder<String, Value> parametersBuilder, String name) {
+    parametersBuilder.put(name, Value.bool(this.item));
   }
 }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/DateParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/DateParser.java
index b8d8b4a5..db82f402 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/DateParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/DateParser.java
@@ -20,10 +20,11 @@ import com.google.cloud.spanner.ErrorCode;
 import com.google.cloud.spanner.ProtobufResultSet;
 import com.google.cloud.spanner.ResultSet;
 import com.google.cloud.spanner.SpannerExceptionFactory;
-import com.google.cloud.spanner.Statement;
+import com.google.cloud.spanner.Value;
 import com.google.cloud.spanner.pgadapter.ProxyServer.DataFormat;
 import com.google.cloud.spanner.pgadapter.error.PGExceptionFactory;
 import com.google.cloud.spanner.pgadapter.session.SessionState;
+import com.google.common.collect.ImmutableMap;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.time.LocalDate;
@@ -176,7 +177,7 @@ public class DateParser extends Parser<Date> {
   }
 
   @Override
-  public void bind(Statement.Builder statementBuilder, String name) {
-    statementBuilder.bind(name).to(this.item);
+  public void bind(ImmutableMap.Builder<String, Value> parametersBuilder, String name) {
+    parametersBuilder.put(name, Value.date(this.item));
   }
 }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/DoubleParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/DoubleParser.java
index db1982f3..15288bbf 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/DoubleParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/DoubleParser.java
@@ -18,9 +18,10 @@ import com.google.api.core.InternalApi;
 import com.google.cloud.spanner.ErrorCode;
 import com.google.cloud.spanner.ResultSet;
 import com.google.cloud.spanner.SpannerExceptionFactory;
-import com.google.cloud.spanner.Statement;
+import com.google.cloud.spanner.Value;
 import com.google.cloud.spanner.pgadapter.ProxyServer.DataFormat;
 import com.google.cloud.spanner.pgadapter.error.PGExceptionFactory;
+import com.google.common.collect.ImmutableMap;
 import java.nio.charset.StandardCharsets;
 import javax.annotation.Nonnull;
 import org.postgresql.util.ByteConverter;
@@ -98,7 +99,7 @@ public class DoubleParser extends Parser<Double> {
   }
 
   @Override
-  public void bind(Statement.Builder statementBuilder, String name) {
-    statementBuilder.bind(name).to(this.item);
+  public void bind(ImmutableMap.Builder<String, Value> parametersBuilder, String name) {
+    parametersBuilder.put(name, Value.float64(this.item));
   }
 }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/FloatParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/FloatParser.java
index 1a0e3760..9f89fd54 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/FloatParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/FloatParser.java
@@ -17,9 +17,10 @@ package com.google.cloud.spanner.pgadapter.parsers;
 import com.google.cloud.spanner.ErrorCode;
 import com.google.cloud.spanner.ResultSet;
 import com.google.cloud.spanner.SpannerExceptionFactory;
-import com.google.cloud.spanner.Statement;
+import com.google.cloud.spanner.Value;
 import com.google.cloud.spanner.pgadapter.ProxyServer.DataFormat;
 import com.google.cloud.spanner.pgadapter.error.PGExceptionFactory;
+import com.google.common.collect.ImmutableMap;
 import java.nio.charset.StandardCharsets;
 import javax.annotation.Nonnull;
 import org.postgresql.util.ByteConverter;
@@ -95,7 +96,7 @@ public class FloatParser extends Parser<Float> {
   }
 
   @Override
-  public void bind(Statement.Builder statementBuilder, String name) {
-    statementBuilder.bind(name).to(this.item);
+  public void bind(ImmutableMap.Builder<String, Value> parametersBuilder, String name) {
+    parametersBuilder.put(name, Value.float32(this.item));
   }
 }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/IntegerParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/IntegerParser.java
index 7f2095a5..18dea13f 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/IntegerParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/IntegerParser.java
@@ -15,8 +15,9 @@
 package com.google.cloud.spanner.pgadapter.parsers;
 
 import com.google.cloud.spanner.ResultSet;
-import com.google.cloud.spanner.Statement;
+import com.google.cloud.spanner.Value;
 import com.google.cloud.spanner.pgadapter.error.PGExceptionFactory;
+import com.google.common.collect.ImmutableMap;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import org.postgresql.util.ByteConverter;
@@ -70,7 +71,7 @@ class IntegerParser extends Parser<Integer> {
   }
 
   @Override
-  public void bind(Statement.Builder statementBuilder, String name) {
-    statementBuilder.bind(name).to(this.item == null ? null : this.item.longValue());
+  public void bind(ImmutableMap.Builder<String, Value> parametersBuilder, String name) {
+    parametersBuilder.put(name, Value.int64(this.item == null ? null : this.item.longValue()));
   }
 }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/JsonbParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/JsonbParser.java
index 8fed8bc1..8ea289c9 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/JsonbParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/JsonbParser.java
@@ -17,13 +17,13 @@ package com.google.cloud.spanner.pgadapter.parsers;
 import com.google.api.core.InternalApi;
 import com.google.cloud.spanner.ProtobufResultSet;
 import com.google.cloud.spanner.ResultSet;
-import com.google.cloud.spanner.Statement;
 import com.google.cloud.spanner.Value;
 import com.google.cloud.spanner.pgadapter.ProxyServer.DataFormat;
 import com.google.cloud.spanner.pgadapter.error.PGException;
 import com.google.cloud.spanner.pgadapter.error.SQLState;
 import com.google.cloud.spanner.pgadapter.error.Severity;
 import com.google.cloud.spanner.pgadapter.session.SessionState;
+import com.google.common.collect.ImmutableMap;
 import java.io.DataOutputStream;
 import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
@@ -127,7 +127,7 @@ public class JsonbParser extends Parser<String> {
   }
 
   @Override
-  public void bind(Statement.Builder statementBuilder, String name) {
-    statementBuilder.bind(name).to(Value.pgJsonb(this.item));
+  public void bind(ImmutableMap.Builder<String, Value> parametersBuilder, String name) {
+    parametersBuilder.put(name, Value.pgJsonb(this.item));
   }
 }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/LongParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/LongParser.java
index 0d890c05..40e9d9fd 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/LongParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/LongParser.java
@@ -19,10 +19,11 @@ import com.google.cloud.spanner.ErrorCode;
 import com.google.cloud.spanner.ProtobufResultSet;
 import com.google.cloud.spanner.ResultSet;
 import com.google.cloud.spanner.SpannerExceptionFactory;
-import com.google.cloud.spanner.Statement;
+import com.google.cloud.spanner.Value;
 import com.google.cloud.spanner.pgadapter.ProxyServer.DataFormat;
 import com.google.cloud.spanner.pgadapter.error.PGExceptionFactory;
 import com.google.cloud.spanner.pgadapter.session.SessionState;
+import com.google.common.collect.ImmutableMap;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.math.BigDecimal;
@@ -140,7 +141,7 @@ public class LongParser extends Parser<Long> {
   }
 
   @Override
-  public void bind(Statement.Builder statementBuilder, String name) {
-    statementBuilder.bind(name).to(this.item);
+  public void bind(ImmutableMap.Builder<String, Value> parametersBuilder, String name) {
+    parametersBuilder.put(name, Value.int64(this.item));
   }
 }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/NumericParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/NumericParser.java
index e5f3d8ac..80aba439 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/NumericParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/NumericParser.java
@@ -18,9 +18,9 @@ import com.google.api.core.InternalApi;
 import com.google.cloud.spanner.ErrorCode;
 import com.google.cloud.spanner.ResultSet;
 import com.google.cloud.spanner.SpannerExceptionFactory;
-import com.google.cloud.spanner.Statement;
 import com.google.cloud.spanner.Value;
 import com.google.cloud.spanner.pgadapter.ProxyServer.DataFormat;
+import com.google.common.collect.ImmutableMap;
 import java.math.BigDecimal;
 import java.nio.charset.StandardCharsets;
 import javax.annotation.Nonnull;
@@ -109,7 +109,7 @@ public class NumericParser extends Parser<String> {
   }
 
   @Override
-  public void bind(Statement.Builder statementBuilder, String name) {
-    statementBuilder.bind(name).to(Value.pgNumeric(stringParse()));
+  public void bind(ImmutableMap.Builder<String, Value> parametersBuilder, String name) {
+    parametersBuilder.put(name, Value.pgNumeric(stringParse()));
   }
 }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/Parser.java b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/Parser.java
index 215032f6..62e944b9 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/Parser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/Parser.java
@@ -16,13 +16,14 @@ package com.google.cloud.spanner.pgadapter.parsers;
 
 import com.google.api.core.InternalApi;
 import com.google.cloud.spanner.ResultSet;
-import com.google.cloud.spanner.Statement;
 import com.google.cloud.spanner.Type;
 import com.google.cloud.spanner.Type.Code;
+import com.google.cloud.spanner.Value;
 import com.google.cloud.spanner.pgadapter.ProxyServer.DataFormat;
 import com.google.cloud.spanner.pgadapter.error.PGExceptionFactory;
 import com.google.cloud.spanner.pgadapter.error.SQLState;
 import com.google.cloud.spanner.pgadapter.session.SessionState;
+import com.google.common.collect.ImmutableMap;
 import com.google.spanner.v1.TypeAnnotationCode;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
@@ -499,5 +500,5 @@ public abstract class Parser<T> {
   /** Used to parse data type onto binary. Override this to change binary representation. */
   protected abstract byte[] binaryParse();
 
-  public abstract void bind(Statement.Builder statementBuilder, String name);
+  public abstract void bind(ImmutableMap.Builder<String, Value> statementBuilder, String name);
 }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/ShortParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/ShortParser.java
index cf61db3a..84a829ef 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/ShortParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/ShortParser.java
@@ -14,8 +14,9 @@
 
 package com.google.cloud.spanner.pgadapter.parsers;
 
-import com.google.cloud.spanner.Statement;
+import com.google.cloud.spanner.Value;
 import com.google.cloud.spanner.pgadapter.error.PGExceptionFactory;
+import com.google.common.collect.ImmutableMap;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import org.postgresql.util.ByteConverter;
@@ -65,7 +66,7 @@ class ShortParser extends Parser<Short> {
   }
 
   @Override
-  public void bind(Statement.Builder statementBuilder, String name) {
-    statementBuilder.bind(name).to(this.item == null ? null : this.item.longValue());
+  public void bind(ImmutableMap.Builder<String, Value> parametersBuilder, String name) {
+    parametersBuilder.put(name, Value.int64(this.item == null ? null : this.item.longValue()));
   }
 }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/StringParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/StringParser.java
index bdd729c8..f2934681 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/StringParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/StringParser.java
@@ -18,9 +18,10 @@ import com.google.api.core.InternalApi;
 import com.google.cloud.spanner.ProtobufResultSet;
 import com.google.cloud.spanner.ResultSet;
 import com.google.cloud.spanner.SpannerExceptionFactory;
-import com.google.cloud.spanner.Statement;
+import com.google.cloud.spanner.Value;
 import com.google.cloud.spanner.pgadapter.session.SessionState;
 import com.google.common.base.Utf8;
+import com.google.common.collect.ImmutableMap;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.io.OutputStreamWriter;
@@ -127,7 +128,7 @@ public class StringParser extends Parser<String> {
   }
 
   @Override
-  public void bind(Statement.Builder statementBuilder, String name) {
-    statementBuilder.bind(name).to(this.item);
+  public void bind(ImmutableMap.Builder<String, Value> parametersBuilder, String name) {
+    parametersBuilder.put(name, Value.string(this.item));
   }
 }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/TimestampParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/TimestampParser.java
index 8f9a6c6e..0e054ef2 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/TimestampParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/TimestampParser.java
@@ -19,11 +19,12 @@ import com.google.cloud.Timestamp;
 import com.google.cloud.spanner.ErrorCode;
 import com.google.cloud.spanner.ResultSet;
 import com.google.cloud.spanner.SpannerExceptionFactory;
-import com.google.cloud.spanner.Statement;
+import com.google.cloud.spanner.Value;
 import com.google.cloud.spanner.pgadapter.ProxyServer.DataFormat;
 import com.google.cloud.spanner.pgadapter.error.PGExceptionFactory;
 import com.google.cloud.spanner.pgadapter.metadata.OptionsMetadata;
 import com.google.cloud.spanner.pgadapter.session.SessionState;
+import com.google.common.collect.ImmutableMap;
 import java.nio.charset.StandardCharsets;
 import java.time.Instant;
 import java.time.LocalDate;
@@ -242,7 +243,7 @@ public class TimestampParser extends Parser<Timestamp> {
   }
 
   @Override
-  public void bind(Statement.Builder statementBuilder, String name) {
-    statementBuilder.bind(name).to(this.item);
+  public void bind(ImmutableMap.Builder<String, Value> parametersBuilder, String name) {
+    parametersBuilder.put(name, Value.timestamp(this.item));
   }
 }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/UnspecifiedParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/UnspecifiedParser.java
index 6762aeaa..05674085 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/UnspecifiedParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/UnspecifiedParser.java
@@ -14,8 +14,8 @@
 
 package com.google.cloud.spanner.pgadapter.parsers;
 
-import com.google.cloud.spanner.Statement.Builder;
 import com.google.cloud.spanner.Value;
+import com.google.common.collect.ImmutableMap;
 import java.nio.charset.StandardCharsets;
 import java.sql.Types;
 
@@ -24,6 +24,11 @@ import java.sql.Types;
  * SQL type will be reported as {@link Types#OTHER}.
  */
 class UnspecifiedParser extends Parser<Value> {
+  private static final Value NULL_VALUE =
+      Value.untyped(
+          com.google.protobuf.Value.newBuilder()
+              .setNullValue(com.google.protobuf.NullValue.NULL_VALUE)
+              .build());
 
   UnspecifiedParser(Object item) {
     this.item = (Value) item;
@@ -52,7 +57,7 @@ class UnspecifiedParser extends Parser<Value> {
   }
 
   @Override
-  public void bind(Builder statementBuilder, String name) {
-    statementBuilder.bind(name).to(this.item);
+  public void bind(ImmutableMap.Builder<String, Value> parametersBuilder, String name) {
+    parametersBuilder.put(name, this.item == null ? NULL_VALUE : this.item);
   }
 }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/UuidParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/UuidParser.java
index 01bebe59..e00b11f2 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/parsers/UuidParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/parsers/UuidParser.java
@@ -15,10 +15,11 @@
 package com.google.cloud.spanner.pgadapter.parsers;
 
 import com.google.api.core.InternalApi;
-import com.google.cloud.spanner.Statement;
+import com.google.cloud.spanner.Value;
 import com.google.cloud.spanner.pgadapter.error.PGException;
 import com.google.cloud.spanner.pgadapter.error.SQLState;
 import com.google.cloud.spanner.pgadapter.error.Severity;
+import com.google.common.collect.ImmutableMap;
 import java.nio.charset.StandardCharsets;
 import java.util.UUID;
 import javax.annotation.Nonnull;
@@ -109,7 +110,7 @@ public class UuidParser extends Parser<String> {
   }
 
   @Override
-  public void bind(Statement.Builder statementBuilder, String name) {
-    statementBuilder.bind(name).to(this.item);
+  public void bind(ImmutableMap.Builder<String, Value> parametersBuilder, String name) {
+    parametersBuilder.put(name, Value.string(this.item));
   }
 }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/statements/BackendConnection.java b/src/main/java/com/google/cloud/spanner/pgadapter/statements/BackendConnection.java
index 80dba8fd..f54bffe4 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/statements/BackendConnection.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/statements/BackendConnection.java
@@ -345,7 +345,7 @@ public class BackendConnection {
           // Ignore the statement as it is a no-op to execute COMMIT/ROLLBACK when we are not in a
           // transaction. TODO: Return a warning.
           result.set(NO_RESULT);
-        } else if (parsedStatement.getSqlWithoutComments().isEmpty()) {
+        } else if (SimpleParser.isEmpty(statement.getSql())) {
           result.set(NO_RESULT);
         } else if (parsedStatement.isDdl()) {
           if (analyze) {
@@ -542,7 +542,7 @@ public class BackendConnection {
           || (parsedStatement.getType() == StatementType.CLIENT_SIDE
               && parsedStatement.getClientSideStatementType()
                   == ClientSideStatementType.RESET_ALL)) {
-        return SessionStatementParser.parse(parsedStatement);
+        return SessionStatementParser.parse(parsedStatement, statement.getSql());
       }
       return null;
     }
@@ -1077,9 +1077,10 @@ public class BackendConnection {
         // Special case: If the setting is one that is handled by the Connection API, then we need
         // to execute the statement on the connection instead.
         try {
-          ParsedStatement parsedStatement = statementParser.parse(Statement.of("set " + command));
+          Statement statement = Statement.of("set " + command);
+          ParsedStatement parsedStatement = statementParser.parse(statement);
           if (parsedStatement.getType() == StatementType.CLIENT_SIDE) {
-            this.spannerConnection.execute(Statement.of(parsedStatement.getSqlWithoutComments()));
+            this.spannerConnection.execute(Statement.of(statement.getSql()));
             continue;
           }
         } catch (Throwable ignore) {
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutor.java b/src/main/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutor.java
index 33146eb7..38016143 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutor.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutor.java
@@ -142,7 +142,7 @@ class DdlExecutor {
    * into one that is supported by the backend.
    */
   Statement translate(ParsedStatement parsedStatement, Statement statement) {
-    SimpleParser parser = new SimpleParser(parsedStatement.getSqlWithoutComments());
+    SimpleParser parser = new SimpleParser(statement.getSql());
     if (parser.eatKeyword("create")) {
       statement = translateCreate(parser, statement);
     }
@@ -158,9 +158,7 @@ class DdlExecutor {
   }
 
   Statement maybeRemovePrimaryKeyConstraintName(Statement createTableStatement) {
-    ParsedStatement parsedStatement =
-        AbstractStatementParser.getInstance(Dialect.POSTGRESQL).parse(createTableStatement);
-    SimpleParser parser = new SimpleParser(parsedStatement.getSqlWithoutComments());
+    SimpleParser parser = new SimpleParser(createTableStatement.getSql());
     parser.eatKeyword("create", "table", "if", "not", "exists");
     TableOrIndexName tableName = parser.readTableOrIndexName();
     if (tableName == null) {
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/statements/IntermediatePortalStatement.java b/src/main/java/com/google/cloud/spanner/pgadapter/statements/IntermediatePortalStatement.java
index e2a93416..3324b520 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/statements/IntermediatePortalStatement.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/statements/IntermediatePortalStatement.java
@@ -16,11 +16,13 @@ package com.google.cloud.spanner.pgadapter.statements;
 
 import com.google.api.core.InternalApi;
 import com.google.cloud.spanner.Statement;
+import com.google.cloud.spanner.Value;
 import com.google.cloud.spanner.connection.StatementResult;
 import com.google.cloud.spanner.connection.StatementResult.ResultType;
 import com.google.cloud.spanner.pgadapter.parsers.Parser;
 import com.google.cloud.spanner.pgadapter.parsers.Parser.FormatCode;
 import com.google.cloud.spanner.pgadapter.statements.BackendConnection.NoResult;
+import com.google.common.collect.ImmutableMap;
 import com.google.common.util.concurrent.Futures;
 import java.util.concurrent.Future;
 
@@ -110,8 +112,8 @@ public class IntermediatePortalStatement extends IntermediatePreparedStatement {
     // Make sure the results from any Describe message are propagated to the prepared statement
     // before using it to bind the parameter values.
     preparedStatement.describe();
-    Statement.Builder builder = statement.toBuilder();
-    for (int index = 0; index < parameters.length; index++) {
+    ImmutableMap.Builder<String, Value> parametersBuilder = ImmutableMap.builder();
+    for (int index = 0; index < this.parameters.length; index++) {
       short formatCode = getParameterFormatCode(index);
       int type = preparedStatement.getParameterDataType(index);
       Parser<?> parser =
@@ -120,12 +122,12 @@ public class IntermediatePortalStatement extends IntermediatePreparedStatement {
                   .getExtendedQueryProtocolHandler()
                   .getBackendConnection()
                   .getSessionState(),
-              parameters[index],
+              this.parameters[index],
               type,
               FormatCode.of(formatCode));
-      parser.bind(builder, "p" + (index + 1));
+      parser.bind(parametersBuilder, "p" + (index + 1));
     }
-    return builder.build();
+    return Statement.of(statement.getSql(), parametersBuilder.build());
   }
 
   @Override
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/statements/SessionStatementParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/statements/SessionStatementParser.java
index c2580bcf..4b5444b2 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/statements/SessionStatementParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/statements/SessionStatementParser.java
@@ -265,13 +265,13 @@ public class SessionStatementParser {
     return value;
   }
 
-  public static @Nullable SessionStatement parse(ParsedStatement parsedStatement) {
+  public static @Nullable SessionStatement parse(ParsedStatement parsedStatement, String sql) {
     if (parsedStatement.getType() == StatementType.CLIENT_SIDE
         && parsedStatement.getClientSideStatementType() != ClientSideStatementType.RESET_ALL) {
       // This statement is handled by the Connection API.
       return null;
     }
-    SimpleParser parser = new SimpleParser(parsedStatement.getSqlWithoutComments());
+    SimpleParser parser = new SimpleParser(sql);
     if (parser.eatKeyword("set")) {
       return parseSetStatement(parser);
     }
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/statements/SimpleParser.java b/src/main/java/com/google/cloud/spanner/pgadapter/statements/SimpleParser.java
index dd5fe9a1..9ba69fde 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/statements/SimpleParser.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/statements/SimpleParser.java
@@ -358,6 +358,11 @@ public class SimpleParser {
     this.pos = pos;
   }
 
+  public static boolean isEmpty(String sql) {
+    SimpleParser parser = new SimpleParser(sql);
+    return !parser.hasMoreTokens();
+  }
+
   /** Returns the command tag of the given SQL string */
   public static String parseCommand(String sql) {
     SimpleParser parser = new SimpleParser(sql);
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/statements/SimpleQueryStatement.java b/src/main/java/com/google/cloud/spanner/pgadapter/statements/SimpleQueryStatement.java
index f1d896d8..55b0e731 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/statements/SimpleQueryStatement.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/statements/SimpleQueryStatement.java
@@ -19,6 +19,7 @@ import static com.google.cloud.spanner.pgadapter.statements.SimpleParser.isComma
 import static com.google.cloud.spanner.pgadapter.wireprotocol.QueryMessage.COPY;
 
 import com.google.api.core.InternalApi;
+import com.google.cloud.Tuple;
 import com.google.cloud.spanner.Dialect;
 import com.google.cloud.spanner.Statement;
 import com.google.cloud.spanner.connection.AbstractStatementParser;
@@ -72,23 +73,25 @@ public class SimpleQueryStatement {
     for (Statement originalStatement : this.statements) {
       boolean isFirst = this.statements.get(0) == originalStatement;
       try {
-        ParsedStatement originalParsedStatement = PARSER.parse(originalStatement);
-        ParsedStatement parsedStatement = originalParsedStatement;
+        ParsedStatement parsedStatement = PARSER.parse(originalStatement);
+        Statement statement = originalStatement;
         if (options.requiresMatcher()
             || connectionHandler.getWellKnownClient() == WellKnownClient.PSQL) {
-          parsedStatement = translatePotentialMetadataCommand(parsedStatement, connectionHandler);
+          statement = translatePotentialMetadataCommand(statement, connectionHandler);
         }
-        parsedStatement =
+        Tuple<Boolean, String> potentiallyReplacedStatement =
             replaceKnownUnsupportedQueries(
-                this.connectionHandler.getWellKnownClient(), this.options, parsedStatement);
-        if (parsedStatement != originalParsedStatement) {
+                this.connectionHandler.getWellKnownClient(), this.options, statement.getSql());
+        if (potentiallyReplacedStatement.x()
+            && !potentiallyReplacedStatement.y().equals(statement.getSql())) {
           // The original statement was replaced.
-          originalStatement = Statement.of(parsedStatement.getSqlWithoutComments());
+          statement = Statement.of(potentiallyReplacedStatement.y());
+          parsedStatement = PARSER.parse(statement);
         }
         // We need to flush the entire pipeline if we encounter a COPY statement, as COPY statements
         // require additional messages to be sent back and forth, and this ensures that we get
         // everything in the correct order.
-        boolean isCopy = isCommand(COPY, parsedStatement.getSqlWithoutComments());
+        boolean isCopy = isCommand(COPY, statement.getSql());
         if (!isFirst && isCopy) {
           new FlushMessage(connectionHandler, ManuallyCreatedToken.MANUALLY_CREATED_TOKEN).send();
           if (connectionHandler
@@ -99,7 +102,7 @@ public class SimpleQueryStatement {
             break;
           }
         }
-        new ParseMessage(connectionHandler, parsedStatement, originalStatement).send();
+        new ParseMessage(connectionHandler, parsedStatement, statement).send();
         new BindMessage(connectionHandler, ManuallyCreatedToken.MANUALLY_CREATED_TOKEN).send();
         new DescribeMessage(connectionHandler, ManuallyCreatedToken.MANUALLY_CREATED_TOKEN).send();
         new ExecuteMessage(connectionHandler, ManuallyCreatedToken.MANUALLY_CREATED_TOKEN).send();
@@ -112,17 +115,13 @@ public class SimpleQueryStatement {
   }
 
   /** Replaces any known unsupported query (e.g. JDBC metadata queries). */
-  static ParsedStatement replaceKnownUnsupportedQueries(
-      WellKnownClient client, OptionsMetadata options, ParsedStatement parsedStatement) {
+  static Tuple<Boolean, String> replaceKnownUnsupportedQueries(
+      WellKnownClient client, OptionsMetadata options, String sql) {
     if ((options.isReplaceJdbcMetadataQueries() || client == WellKnownClient.JDBC)
-        && JdbcMetadataStatementHelper.isPotentialJdbcMetadataStatement(
-            parsedStatement.getSqlWithoutComments())) {
-      return PARSER.parse(
-          Statement.of(
-              JdbcMetadataStatementHelper.replaceJdbcMetadataStatement(
-                  parsedStatement.getSqlWithoutComments())));
+        && JdbcMetadataStatementHelper.isPotentialJdbcMetadataStatement(sql)) {
+      return Tuple.of(Boolean.TRUE, JdbcMetadataStatementHelper.replaceJdbcMetadataStatement(sql));
     }
-    return parsedStatement;
+    return Tuple.of(Boolean.FALSE, sql);
   }
 
   /**
@@ -134,24 +133,24 @@ public class SimpleQueryStatement {
    *     returns the original Statement.
    */
   @VisibleForTesting
-  static ParsedStatement translatePotentialMetadataCommand(
-      ParsedStatement parsedStatement, ConnectionHandler connectionHandler) {
+  static Statement translatePotentialMetadataCommand(
+      Statement parsedStatement, ConnectionHandler connectionHandler) {
     Tracer tracer = connectionHandler.getExtendedQueryProtocolHandler().getTracer();
     Span span =
         tracer
             .spanBuilder("translatePotentialMetadataCommand")
             .setAttribute(
                 "pgadapter.connection_id", connectionHandler.getTraceConnectionId().toString())
-            .setAttribute(DB_STATEMENT, parsedStatement.getSqlWithoutComments())
+            .setAttribute(DB_STATEMENT, parsedStatement.getSql())
             .startSpan();
     try (Scope ignore = span.makeCurrent()) {
       for (Command currentCommand :
           Command.getCommands(
-              parsedStatement.getSqlWithoutComments(),
+              parsedStatement.getSql(),
               connectionHandler.getSpannerConnection(),
               connectionHandler.getServer().getOptions().getCommandMetadataJSON())) {
         if (currentCommand.is()) {
-          return PARSER.parse(Statement.of(currentCommand.translate()));
+          return Statement.of(currentCommand.translate());
         }
       }
       return parsedStatement;
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/wireprotocol/ParseMessage.java b/src/main/java/com/google/cloud/spanner/pgadapter/wireprotocol/ParseMessage.java
index 762e4251..2e233fbf 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/wireprotocol/ParseMessage.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/wireprotocol/ParseMessage.java
@@ -109,7 +109,7 @@ public class ParseMessage extends AbstractQueryProtocolMessage {
       Statement originalStatement) {
     super(
         connection,
-        5 + parsedStatement.getSqlWithoutComments().length(),
+        5 + originalStatement.getSql().length(),
         ManuallyCreatedToken.MANUALLY_CREATED_TOKEN);
     this.name = name;
     this.parameterDataTypes = parameterDataTypes;


Test patch:
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/statements/IntermediateStatement.java b/src/main/java/com/google/cloud/spanner/pgadapter/statements/IntermediateStatement.java
index a6ce2561..d13f0a0d 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/statements/IntermediateStatement.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/statements/IntermediateStatement.java
@@ -18,6 +18,7 @@ import static com.google.cloud.spanner.pgadapter.statements.MoveStatement.MOVE_C
 import static com.google.cloud.spanner.pgadapter.statements.SimpleParser.parseCommand;
 
 import com.google.api.core.InternalApi;
+import com.google.cloud.Tuple;
 import com.google.cloud.spanner.Dialect;
 import com.google.cloud.spanner.ResultSet;
 import com.google.cloud.spanner.Statement;
@@ -98,19 +99,22 @@ public class IntermediateStatement {
       Statement originalStatement) {
     this.connectionHandler = connectionHandler;
     this.options = options;
-    ParsedStatement potentiallyReplacedStatement =
+    Tuple<Boolean, String> potentiallyReplacedStatement =
         SimpleQueryStatement.replaceKnownUnsupportedQueries(
-            this.connectionHandler.getWellKnownClient(), this.options, parsedStatement);
+            this.connectionHandler.getWellKnownClient(), this.options, originalStatement.getSql());
     // Check if we need to create a new 'original' statement. The original statement is what will be
     // sent to Cloud Spanner, as the statement might include query hints in comments.
-    if (potentiallyReplacedStatement == parsedStatement) {
-      this.originalStatement = originalStatement;
+    if (potentiallyReplacedStatement.x()
+        && !originalStatement.getSql().equals(potentiallyReplacedStatement.y())) {
+      this.originalStatement = Statement.of(potentiallyReplacedStatement.y());
+      this.parsedStatement =
+          AbstractStatementParser.getInstance(Dialect.POSTGRESQL).parse(this.originalStatement);
     } else {
-      this.originalStatement = Statement.of(potentiallyReplacedStatement.getSqlWithoutComments());
+      this.originalStatement = originalStatement;
+      this.parsedStatement = parsedStatement;
     }
-    this.parsedStatement = potentiallyReplacedStatement;
     this.connection = connectionHandler.getSpannerConnection();
-    this.command = parseCommand(this.parsedStatement.getSqlWithoutComments());
+    this.command = parseCommand(this.originalStatement.getSql());
     this.commandTag = this.command;
     this.outputStream = connectionHandler.getConnectionMetadata().getOutputStream();
   }
@@ -243,7 +247,7 @@ public class IntermediateStatement {
   }
 
   public String getStatement() {
-    return this.parsedStatement.getSqlWithoutComments();
+    return this.originalStatement.getSql();
   }
 
   @VisibleForTesting
@@ -287,7 +291,7 @@ public class IntermediateStatement {
   }
 
   public String getSql() {
-    return this.parsedStatement.getSqlWithoutComments();
+    return this.originalStatement.getSql();
   }
 
   /** Returns any execution exception registered for this statement. */
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/parsers/JsonbParserTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/parsers/JsonbParserTest.java
index 87a0ebe1..f06ed97f 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/parsers/JsonbParserTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/parsers/JsonbParserTest.java
@@ -16,12 +16,14 @@ package com.google.cloud.spanner.pgadapter.parsers;
 
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertThrows;
 
-import com.google.cloud.spanner.Statement;
+import com.google.cloud.spanner.Value;
 import com.google.cloud.spanner.pgadapter.error.PGException;
 import com.google.cloud.spanner.pgadapter.parsers.Parser.FormatCode;
+import com.google.common.collect.ImmutableMap;
 import java.nio.charset.StandardCharsets;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -82,9 +84,12 @@ public class JsonbParserTest {
 
   @Test
   public void testBind() {
-    Statement.Builder builder = Statement.newBuilder("select $1");
+    ImmutableMap.Builder<String, Value> builder = ImmutableMap.builder();
     new JsonbParser("{\"key\": \"value\"}".getBytes(StandardCharsets.UTF_8), FormatCode.TEXT)
         .bind(builder, "p1");
-    assertEquals("{\"key\": \"value\"}", builder.build().getParameters().get("p1").getString());
+    ImmutableMap<String, Value> parameters = builder.build();
+    Value value = parameters.get("p1");
+    assertNotNull(value);
+    assertEquals("{\"key\": \"value\"}", value.getString());
   }
 }
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/statements/BackendConnectionTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/statements/BackendConnectionTest.java
index b9a1faf5..df4956a9 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/statements/BackendConnectionTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/statements/BackendConnectionTest.java
@@ -392,8 +392,6 @@ public class BackendConnectionTest {
         .thenReturn(listDatabasesResult);
     ImmutableList<LocalStatement> localStatements = ImmutableList.of(listDatabasesStatement);
     ParsedStatement parsedListDatabasesStatement = mock(ParsedStatement.class);
-    when(parsedListDatabasesStatement.getSqlWithoutComments())
-        .thenReturn(ListDatabasesStatement.LIST_DATABASES_SQL);
 
     BackendConnection backendConnection =
         new BackendConnection(
@@ -434,7 +432,6 @@ public class BackendConnectionTest {
     when(statementResult.getResultType()).thenReturn(ResultType.RESULT_SET);
     ParsedStatement parsedStatement = mock(ParsedStatement.class);
     String sql = "SELECT * FROM foo";
-    when(parsedStatement.getSqlWithoutComments()).thenReturn(sql);
     Statement statement = Statement.of(sql);
     when(connection.execute(statement)).thenReturn(statementResult);
 
@@ -475,7 +472,6 @@ public class BackendConnectionTest {
     Connection connection = mock(Connection.class);
     Statement statement = Statement.of("select foo from bar");
     ParsedStatement parsedStatement = mock(ParsedStatement.class);
-    when(parsedStatement.getSqlWithoutComments()).thenReturn(statement.getSql());
     RuntimeException error = new RuntimeException("test error");
     when(connection.execute(statement)).thenThrow(error);
 
@@ -507,7 +503,6 @@ public class BackendConnectionTest {
 
     Statement statement = Statement.of("insert into foo (id) values (1)");
     ParsedStatement parsedStatement = mock(ParsedStatement.class);
-    when(parsedStatement.getSqlWithoutComments()).thenReturn(statement.getSql());
     RuntimeException error = new RuntimeException("test error");
     when(connection.execute(statement)).thenThrow(error);
 
@@ -544,7 +539,6 @@ public class BackendConnectionTest {
 
     Statement commitStatement = Statement.of("commit");
     ParsedStatement parsedCommitStatement = mock(ParsedStatement.class);
-    when(parsedCommitStatement.getSqlWithoutComments()).thenReturn(commitStatement.getSql());
     when(parsedCommitStatement.getType()).thenReturn(StatementType.CLIENT_SIDE);
     when(parsedCommitStatement.getClientSideStatementType())
         .thenReturn(ClientSideStatementType.COMMIT);
@@ -589,7 +583,6 @@ public class BackendConnectionTest {
 
     Statement rollbackStatement = Statement.of("rollback");
     ParsedStatement parsedRollbackStatement = mock(ParsedStatement.class);
-    when(parsedRollbackStatement.getSqlWithoutComments()).thenReturn(rollbackStatement.getSql());
     when(parsedRollbackStatement.getType()).thenReturn(StatementType.CLIENT_SIDE);
     when(parsedRollbackStatement.getClientSideStatementType())
         .thenReturn(ClientSideStatementType.ROLLBACK);
@@ -632,7 +625,6 @@ public class BackendConnectionTest {
     Connection connection = mock(Connection.class);
     Statement statement = Statement.of("select foo from bar");
     ParsedStatement parsedStatement = mock(ParsedStatement.class);
-    when(parsedStatement.getSqlWithoutComments()).thenReturn(statement.getSql());
     SpannerException error =
         SpannerExceptionFactory.newSpannerException(ErrorCode.CANCELLED, "query cancelled");
     when(connection.execute(statement)).thenThrow(error);
@@ -668,11 +660,9 @@ public class BackendConnectionTest {
     Connection connection = mock(Connection.class);
     ParsedStatement parsedStatement1 = mock(ParsedStatement.class);
     when(parsedStatement1.getType()).thenReturn(StatementType.DDL);
-    when(parsedStatement1.getSqlWithoutComments()).thenReturn(sql1);
 
     ParsedStatement parsedStatement2 = mock(ParsedStatement.class);
     when(parsedStatement2.getType()).thenReturn(StatementType.DDL);
-    when(parsedStatement2.getSqlWithoutComments()).thenReturn(sql2);
 
     Statement statement1 = Statement.of(sql1);
     Statement statement2 = Statement.of(sql2);
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/statements/PSQLTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/statements/PSQLTest.java
index 7a65bb7a..3aecf0a9 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/statements/PSQLTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/statements/PSQLTest.java
@@ -19,7 +19,6 @@ import static org.junit.Assert.assertEquals;
 import com.google.cloud.spanner.Dialect;
 import com.google.cloud.spanner.Statement;
 import com.google.cloud.spanner.connection.AbstractStatementParser;
-import com.google.cloud.spanner.connection.AbstractStatementParser.ParsedStatement;
 import com.google.cloud.spanner.connection.Connection;
 import com.google.cloud.spanner.pgadapter.ConnectionHandler;
 import com.google.cloud.spanner.pgadapter.ProxyServer;
@@ -46,10 +45,6 @@ public class PSQLTest {
   private static final AbstractStatementParser PARSER =
       AbstractStatementParser.getInstance(Dialect.POSTGRESQL);
 
-  private static ParsedStatement parse(String sql) {
-    return PARSER.parse(Statement.of(sql));
-  }
-
   @Rule public MockitoRule rule = MockitoJUnit.rule();
 
   @Mock private ConnectionHandler connectionHandler;
@@ -79,8 +74,9 @@ public class PSQLTest {
   }
 
   private String translate(String sql) {
-    return SimpleQueryStatement.translatePotentialMetadataCommand(parse(sql), connectionHandler)
-        .getSqlWithoutComments();
+    return SimpleQueryStatement.translatePotentialMetadataCommand(
+            Statement.of(sql), connectionHandler)
+        .getSql();
   }
 
   @Test
@@ -111,7 +107,7 @@ public class PSQLTest {
             + "FROM"
             + " information_schema.tables AS t "
             + "WHERE"
-            + " t.table_schema = 'public'";
+            + " t.table_schema = 'public';";
 
     assertEquals(expected, translate(sql));
   }
@@ -138,7 +134,7 @@ public class PSQLTest {
             + " WHERE"
             + " t.table_schema='public'"
             + " AND"
-            + " LOWER(t.table_name) = LOWER('users')";
+            + " LOWER(t.table_name) = LOWER('users');";
 
     assertEquals(expected, translate(sql));
   }
@@ -165,7 +161,7 @@ public class PSQLTest {
             + " WHERE"
             + " t.table_schema='public'"
             + " AND"
-            + " LOWER(t.table_name) = LOWER('bobby''; DROP TABLE USERS; SELECT''')";
+            + " LOWER(t.table_name) = LOWER('bobby''; DROP TABLE USERS; SELECT''');";
 
     assertEquals(expected, translate(sql));
   }
@@ -188,7 +184,7 @@ public class PSQLTest {
             + " false as bool2,"
             + " false as relhasoids,"
             + " '' as str1,"
-            + " '' as str2";
+            + " '' as str2;";
 
     assertEquals(expected, translate(sql));
   }
@@ -222,7 +218,7 @@ public class PSQLTest {
             + " information_schema.columns AS t"
             + " WHERE"
             + " t.table_schema='public'"
-            + " AND t.table_name = '-1'";
+            + " AND t.table_name = '-1';";
 
     assertEquals(expected, translate(sql));
   }
@@ -257,7 +253,7 @@ public class PSQLTest {
             + " information_schema.columns AS t"
             + " WHERE"
             + " t.table_schema='public'"
-            + " AND t.table_name = 'bobby''; DROP TABLE USERS; SELECT'''";
+            + " AND t.table_name = 'bobby''; DROP TABLE USERS; SELECT''';";
 
     assertEquals(expected, translate(sql));
   }
@@ -269,7 +265,7 @@ public class PSQLTest {
         "SELECT c.oid::pg_catalog.regclass FROM pg_catalog.pg_class c, pg_catalog.pg_inherits i"
             + " WHERE c.oid=i.inhparent AND i.inhrelid = '-2264987671676060158' AND c.relkind !="
             + " 'p' ORDER BY inhseqno;";
-    String expected = "SELECT 1 LIMIT 0";
+    String expected = "SELECT 1 LIMIT 0;";
 
     assertEquals(expected, translate(sql));
   }
@@ -281,7 +277,7 @@ public class PSQLTest {
         "SELECT c.oid::pg_catalog.regclass FROM pg_catalog.pg_class c, pg_catalog.pg_inherits i"
             + " WHERE c.oid=i.inhrelid AND i.inhparent = '-2264987671676060158' ORDER BY"
             + " c.relname;";
-    String expected = "SELECT 1 LIMIT 0";
+    String expected = "SELECT 1 LIMIT 0;";
 
     assertEquals(expected, translate(sql));
   }
@@ -352,7 +348,7 @@ public class PSQLTest {
             + "      AND n.nspname !~ '^pg_toast'\n"
             + "  AND pg_catalog.pg_table_is_visible(c.oid)\n"
             + "ORDER BY 1,2;";
-    String expected = "SELECT * FROM information_schema.tables";
+    String expected = "SELECT * FROM information_schema.tables;";
 
     assertEquals(expected, translate(sql));
   }
@@ -376,7 +372,7 @@ public class PSQLTest {
             + "  AND pg_catalog.pg_table_is_visible(c.oid)\n"
             + "ORDER BY 1,2;";
     String expected =
-        "SELECT * FROM information_schema.tables WHERE table_schema='public' AND LOWER(table_name) = LOWER('users')";
+        "SELECT * FROM information_schema.tables WHERE table_schema='public' AND LOWER(table_name) = LOWER('users');";
 
     assertEquals(expected, translate(sql));
   }
@@ -401,7 +397,7 @@ public class PSQLTest {
             + "ORDER BY 1,2;";
     String expected =
         "SELECT * FROM information_schema.tables WHERE table_schema='public' AND LOWER(table_name) ="
-            + " LOWER('bobby''; DROP TABLE USERS; SELECT''')";
+            + " LOWER('bobby''; DROP TABLE USERS; SELECT''');";
 
     assertEquals(expected, translate(sql));
   }
@@ -429,7 +425,7 @@ public class PSQLTest {
             + "  AND pg_catalog.pg_table_is_visible(c.oid)\n"
             + "ORDER BY 1,2;";
     String expected =
-        "SELECT table_catalog, table_schema, table_name, index_name, index_type, parent_table_name, is_unique, is_null_filtered, index_state, spanner_is_managed FROM information_schema.indexes";
+        "SELECT table_catalog, table_schema, table_name, index_name, index_type, parent_table_name, is_unique, is_null_filtered, index_state, spanner_is_managed FROM information_schema.indexes;";
 
     assertEquals(expected, translate(sql));
   }
@@ -457,7 +453,7 @@ public class PSQLTest {
             + "ORDER BY 1,2;";
     String expected =
         "SELECT table_catalog, table_schema, table_name, index_name, index_type, parent_table_name, is_unique, is_null_filtered, index_state, spanner_is_managed FROM information_schema.indexes WHERE table_schema='public' AND LOWER(index_name) ="
-            + " LOWER('index')";
+            + " LOWER('index');";
 
     assertEquals(expected, translate(sql));
   }
@@ -485,7 +481,7 @@ public class PSQLTest {
             + "ORDER BY 1,2;";
     String expected =
         "SELECT table_catalog, table_schema, table_name, index_name, index_type, parent_table_name, is_unique, is_null_filtered, index_state, spanner_is_managed FROM information_schema.indexes WHERE table_schema='public' AND LOWER(index_name) ="
-            + " LOWER('bobby''; DROP TABLE USERS; SELECT''')";
+            + " LOWER('bobby''; DROP TABLE USERS; SELECT''');";
 
     assertEquals(expected, translate(sql));
   }
@@ -499,7 +495,7 @@ public class PSQLTest {
             + "FROM pg_catalog.pg_namespace n\n"
             + "WHERE n.nspname !~ '^pg_' AND n.nspname <> 'information_schema'\n"
             + "ORDER BY 1;";
-    String expected = "SELECT * FROM information_schema.schemata";
+    String expected = "SELECT * FROM information_schema.schemata;";
 
     assertEquals(expected, translate(sql));
   }
@@ -514,7 +510,7 @@ public class PSQLTest {
             + "WHERE n.nspname OPERATOR(pg_catalog.~) '^(schema)$'\n"
             + "ORDER BY 1;";
     String expected =
-        "SELECT * FROM information_schema.schemata WHERE LOWER(schema_name) = LOWER('schema')";
+        "SELECT * FROM information_schema.schemata WHERE LOWER(schema_name) = LOWER('schema');";
 
     assertEquals(expected, translate(sql));
   }
@@ -530,7 +526,7 @@ public class PSQLTest {
             + "ORDER BY 1;";
     String expected =
         "SELECT * FROM information_schema.schemata WHERE LOWER(schema_name) = LOWER('bobby''; DROP"
-            + " TABLE USERS; SELECT''')";
+            + " TABLE USERS; SELECT''');";
 
     assertEquals(expected, translate(sql));
   }
@@ -565,7 +561,7 @@ public class PSQLTest {
     String expected =
         "SELECT table_name AS quote_ident FROM information_schema.tables WHERE"
             + " table_schema = 'public' and STARTS_WITH(LOWER(table_name),"
-            + " LOWER('user')) LIMIT 1000";
+            + " LOWER('user')) LIMIT 1000;";
 
     assertEquals(expected, translate(sql));
   }
@@ -599,7 +595,7 @@ public class PSQLTest {
     String expected =
         "SELECT table_name AS quote_ident FROM information_schema.tables WHERE"
             + " table_schema = 'public' and STARTS_WITH(LOWER(table_name),"
-            + " LOWER('user')) LIMIT 1000";
+            + " LOWER('user')) LIMIT 1000;";
 
     assertEquals(expected, translate(sql));
   }
@@ -617,7 +613,7 @@ public class PSQLTest {
             + "LIMIT 1000";
     String expected =
         "SELECT column_name AS quote_ident FROM information_schema.columns WHERE"
-            + " table_schema='public' AND table_name = 'user' AND STARTS_WITH(LOWER(COLUMN_NAME), LOWER('age')) LIMIT 1000";
+            + " table_schema='public' AND table_name = 'user' AND STARTS_WITH(LOWER(COLUMN_NAME), LOWER('age')) LIMIT 1000;";
 
     assertEquals(expected, translate(sql));
   }
@@ -649,7 +645,7 @@ public class PSQLTest {
             + "LIMIT 1000";
     String expected =
         "SELECT table_name AS quote_ident FROM information_schema.tables WHERE "
-            + "table_schema = 'public' AND STARTS_WITH(LOWER(table_name), LOWER('user')) LIMIT 1000";
+            + "table_schema = 'public' AND STARTS_WITH(LOWER(table_name), LOWER('user')) LIMIT 1000;";
 
     assertEquals(expected, translate(sql));
   }
@@ -681,7 +677,7 @@ public class PSQLTest {
             + "LIMIT 1000";
     String expected =
         "SELECT table_name AS quote_ident FROM INFORMATION_SCHEMA.TABLES WHERE"
-            + " table_schema='public' AND STARTS_WITH(LOWER(table_name), LOWER('user')) LIMIT 1000";
+            + " table_schema='public' AND STARTS_WITH(LOWER(table_name), LOWER('user')) LIMIT 1000;";
 
     assertEquals(expected, translate(sql));
   }
@@ -713,7 +709,7 @@ public class PSQLTest {
             + "LIMIT 1000";
     String expected =
         "SELECT index_name AS quote_ident FROM INFORMATION_SCHEMA.INDEXES WHERE"
-            + " table_schema='public' AND STARTS_WITH(LOWER(index_name), LOWER('index')) LIMIT 1000";
+            + " table_schema='public' AND STARTS_WITH(LOWER(index_name), LOWER('index')) LIMIT 1000;";
 
     assertEquals(expected, translate(sql));
   }
@@ -727,7 +723,7 @@ public class PSQLTest {
             + "LIMIT 1000";
     String expected =
         "SELECT schema_name AS quote_ident FROM INFORMATION_SCHEMA.SCHEMATA WHERE"
-            + " STARTS_WITH(LOWER(schema_name), LOWER('schema')) LIMIT 1000";
+            + " STARTS_WITH(LOWER(schema_name), LOWER('schema')) LIMIT 1000;";
 
     assertEquals(expected, translate(sql));
   }
@@ -756,9 +752,9 @@ public class PSQLTest {
     Mockito.when(server.getOptions()).thenReturn(options);
     Mockito.when(options.getCommandMetadataJSON()).thenReturn((JSONObject) parser.parse(inputJSON));
 
-    String firstSQL = "SELECT * FROM USERS;";
+    String firstSQL = "SELECT * FROM USERS";
     String expectedFirstResult = "RESULT 1";
-    String secondSQL = "SELECT name FROM USERS WHERE age = 30;";
+    String secondSQL = "SELECT name FROM USERS WHERE age = 30";
     String expectedSecondResult = "RESULT 2: selector=name, arg2=30, arg1=age";
 
     assertEquals(expectedFirstResult, translate(firstSQL));
@@ -784,7 +780,7 @@ public class PSQLTest {
     Mockito.when(server.getOptions()).thenReturn(options);
     Mockito.when(options.getCommandMetadataJSON()).thenReturn((JSONObject) parser.parse(inputJSON));
 
-    String sql = "SELECT * FROM USERS;";
+    String sql = "SELECT * FROM USERS";
     String expectedResult = "TABLE: USERS, EXPRESSION: *";
 
     assertEquals(expectedResult, translate(sql));
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/statements/SessionStatementParserTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/statements/SessionStatementParserTest.java
index 810c27f4..b38e927d 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/statements/SessionStatementParserTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/statements/SessionStatementParserTest.java
@@ -22,6 +22,7 @@ import com.google.cloud.spanner.SpannerException;
 import com.google.cloud.spanner.Statement;
 import com.google.cloud.spanner.connection.AbstractStatementParser;
 import com.google.cloud.spanner.pgadapter.statements.SessionStatementParser.ResetStatement;
+import com.google.cloud.spanner.pgadapter.statements.SessionStatementParser.SessionStatement;
 import com.google.cloud.spanner.pgadapter.statements.SessionStatementParser.SetStatement;
 import com.google.cloud.spanner.pgadapter.statements.SessionStatementParser.ShowStatement;
 import com.google.cloud.spanner.pgadapter.statements.SimpleParser.TableOrIndexName;
@@ -34,163 +35,108 @@ public class SessionStatementParserTest {
   private static final AbstractStatementParser PG_PARSER =
       AbstractStatementParser.getInstance(Dialect.POSTGRESQL);
 
+  static SessionStatement parse(String sql) {
+    return SessionStatementParser.parse(PG_PARSER.parse(Statement.of(sql)), sql);
+  }
+
   @Test
   public void testParseShowAll() {
-    assertEquals(
-        ShowStatement.createShowAll(),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("show all"))));
+    assertEquals(ShowStatement.createShowAll(), parse("show all"));
   }
 
   @Test
   public void testParseShow() {
-    assertEquals(
-        new ShowStatement(new TableOrIndexName("foo", "bar")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("show foo.bar"))));
+    assertEquals(new ShowStatement(new TableOrIndexName("foo", "bar")), parse("show foo.bar"));
 
-    assertEquals(
-        new ShowStatement(new TableOrIndexName("foo")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("show foo"))));
-    assertEquals(
-        new ShowStatement(new TableOrIndexName("foo")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("show \"foo\""))));
-    assertEquals(
-        new ShowStatement(new TableOrIndexName("foo")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("show\t\"foo\""))));
-    assertEquals(
-        new ShowStatement(new TableOrIndexName("foo")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("show FOO"))));
-    assertEquals(
-        new ShowStatement(new TableOrIndexName("foo")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("show \"FOO\""))));
-    assertEquals(
-        new ShowStatement(new TableOrIndexName("foo")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("show\t\"FOO\""))));
+    assertEquals(new ShowStatement(new TableOrIndexName("foo")), parse("show foo"));
+    assertEquals(new ShowStatement(new TableOrIndexName("foo")), parse("show \"foo\""));
+    assertEquals(new ShowStatement(new TableOrIndexName("foo")), parse("show\t\"foo\""));
+    assertEquals(new ShowStatement(new TableOrIndexName("foo")), parse("show FOO"));
+    assertEquals(new ShowStatement(new TableOrIndexName("foo")), parse("show \"FOO\""));
+    assertEquals(new ShowStatement(new TableOrIndexName("foo")), parse("show\t\"FOO\""));
 
+    assertEquals(new ShowStatement(new TableOrIndexName("foo", "bar")), parse("show foo.bar"));
+    assertEquals(new ShowStatement(new TableOrIndexName("foo", "bar")), parse("show \"FOO\".bar"));
     assertEquals(
-        new ShowStatement(new TableOrIndexName("foo", "bar")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("show foo.bar"))));
-    assertEquals(
-        new ShowStatement(new TableOrIndexName("foo", "bar")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("show \"FOO\".bar"))));
-    assertEquals(
-        new ShowStatement(new TableOrIndexName("foo", "bar")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("show\t\"FOO\".\"Bar\""))));
+        new ShowStatement(new TableOrIndexName("foo", "bar")), parse("show\t\"FOO\".\"Bar\""));
 
-    assertThrows(
-        SpannerException.class,
-        () -> SessionStatementParser.parse(PG_PARSER.parse(Statement.of("show"))));
-    assertThrows(
-        SpannerException.class,
-        () -> SessionStatementParser.parse(PG_PARSER.parse(Statement.of("show foo bar"))));
+    assertThrows(SpannerException.class, () -> parse("show"));
+    assertThrows(SpannerException.class, () -> parse("show foo bar"));
   }
 
   @Test
   public void testParseReset() {
-    assertEquals(
-        new ResetStatement(new TableOrIndexName("foo")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("reset foo"))));
-    assertEquals(
-        new ResetStatement(new TableOrIndexName("foo")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("reset \"foo\""))));
-    assertEquals(
-        new ResetStatement(new TableOrIndexName("foo")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("reset\t\"foo\""))));
-    assertEquals(
-        new ResetStatement(new TableOrIndexName("foo")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("reset FOO"))));
-    assertEquals(
-        new ResetStatement(new TableOrIndexName("foo")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("reset \"FOO\""))));
-    assertEquals(
-        new ResetStatement(new TableOrIndexName("foo")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("reset\t\"FOO\""))));
+    assertEquals(new ResetStatement(new TableOrIndexName("foo")), parse("reset foo"));
+    assertEquals(new ResetStatement(new TableOrIndexName("foo")), parse("reset \"foo\""));
+    assertEquals(new ResetStatement(new TableOrIndexName("foo")), parse("reset\t\"foo\""));
+    assertEquals(new ResetStatement(new TableOrIndexName("foo")), parse("reset FOO"));
+    assertEquals(new ResetStatement(new TableOrIndexName("foo")), parse("reset \"FOO\""));
+    assertEquals(new ResetStatement(new TableOrIndexName("foo")), parse("reset\t\"FOO\""));
 
+    assertEquals(new ResetStatement(new TableOrIndexName("foo", "bar")), parse("reset foo.bar"));
     assertEquals(
-        new ResetStatement(new TableOrIndexName("foo", "bar")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("reset foo.bar"))));
-    assertEquals(
-        new ResetStatement(new TableOrIndexName("foo", "bar")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("reset \"FOO\".bar"))));
+        new ResetStatement(new TableOrIndexName("foo", "bar")), parse("reset \"FOO\".bar"));
     assertEquals(
-        new ResetStatement(new TableOrIndexName("foo", "bar")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("reset\t\"FOO\".\"Bar\""))));
+        new ResetStatement(new TableOrIndexName("foo", "bar")), parse("reset\t\"FOO\".\"Bar\""));
 
-    assertThrows(
-        SpannerException.class,
-        () -> SessionStatementParser.parse(PG_PARSER.parse(Statement.of("reset"))));
-    assertThrows(
-        SpannerException.class,
-        () -> SessionStatementParser.parse(PG_PARSER.parse(Statement.of("reset foo bar"))));
+    assertThrows(SpannerException.class, () -> parse("reset"));
+    assertThrows(SpannerException.class, () -> parse("reset foo bar"));
   }
 
   @Test
   public void testParseResetAll() {
-    assertEquals(
-        ResetStatement.createResetAll(),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("reset all"))));
+    assertEquals(ResetStatement.createResetAll(), parse("reset all"));
   }
 
   @Test
   public void testParseSetTo() {
     assertEquals(
-        new SetStatement(false, new TableOrIndexName("foo"), "bar"),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("set foo to bar"))));
+        new SetStatement(false, new TableOrIndexName("foo"), "bar"), parse("set foo to bar"));
     assertEquals(
         new SetStatement(false, new TableOrIndexName("foo"), "bar"),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("set session foo to bar"))));
+        parse("set session foo to bar"));
     assertEquals(
-        new SetStatement(true, new TableOrIndexName("foo"), "bar"),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("set local foo to bar"))));
+        new SetStatement(true, new TableOrIndexName("foo"), "bar"), parse("set local foo to bar"));
     assertEquals(
-        new SetStatement(false, new TableOrIndexName("foo"), "bar"),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("set \"foo\" to 'bar'"))));
+        new SetStatement(false, new TableOrIndexName("foo"), "bar"), parse("set \"foo\" to 'bar'"));
     assertEquals(
         new SetStatement(false, new TableOrIndexName("foo"), "bar"),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("set \"foo\" to \"bar\""))));
+        parse("set \"foo\" to \"bar\""));
     assertEquals(
-        new SetStatement(false, new TableOrIndexName("foo"), null),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("set foo to default"))));
+        new SetStatement(false, new TableOrIndexName("foo"), null), parse("set foo to default"));
   }
 
   @Test
   public void testParseSetEquals() {
     assertEquals(
-        new SetStatement(false, new TableOrIndexName("foo"), "bar"),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("set foo = bar"))));
+        new SetStatement(false, new TableOrIndexName("foo"), "bar"), parse("set foo = bar"));
     assertEquals(
         new SetStatement(false, new TableOrIndexName("foo"), "bar"),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("set session foo = bar"))));
+        parse("set session foo = bar"));
     assertEquals(
-        new SetStatement(true, new TableOrIndexName("foo"), "bar"),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("set local foo = bar"))));
+        new SetStatement(true, new TableOrIndexName("foo"), "bar"), parse("set local foo = bar"));
     assertEquals(
-        new SetStatement(false, new TableOrIndexName("foo"), "bar"),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("set \"foo\" = 'bar'"))));
+        new SetStatement(false, new TableOrIndexName("foo"), "bar"), parse("set \"foo\" = 'bar'"));
     assertEquals(
         new SetStatement(false, new TableOrIndexName("foo"), "bar"),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("set \"foo\" = \"bar\""))));
+        parse("set \"foo\" = \"bar\""));
     assertEquals(
-        new SetStatement(false, new TableOrIndexName("foo"), null),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("set foo = default"))));
+        new SetStatement(false, new TableOrIndexName("foo"), null), parse("set foo = default"));
   }
 
   @Test
   public void testSetTimeZone() {
     assertEquals(
         new SetStatement(false, new TableOrIndexName("TIMEZONE"), "'UTC'"),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("set time zone 'UTC'"))));
+        parse("set time zone 'UTC'"));
     assertEquals(
         new SetStatement(false, new TableOrIndexName("TIMEZONE"), "'UTC'"),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("set TIME ZONE 'UTC'"))));
+        parse("set TIME ZONE 'UTC'"));
   }
 
   @Test
   public void testShowTimeZone() {
-    assertEquals(
-        new ShowStatement(new TableOrIndexName("timezone")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("show time zone"))));
-    assertEquals(
-        new ShowStatement(new TableOrIndexName("timezone")),
-        SessionStatementParser.parse(PG_PARSER.parse(Statement.of("show TIME ZONE"))));
+    assertEquals(new ShowStatement(new TableOrIndexName("timezone")), parse("show time zone"));
+    assertEquals(new ShowStatement(new TableOrIndexName("timezone")), parse("show TIME ZONE"));
   }
 }
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/wireprotocol/ProtocolTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/wireprotocol/ProtocolTest.java
index fc83f50d..59f3df9e 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/wireprotocol/ProtocolTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/wireprotocol/ProtocolTest.java
@@ -302,7 +302,8 @@ public class ProtocolTest {
             parameters);
 
     int[] expectedParameterDataTypes = new int[] {1002};
-    String expectedSQL = "SELECT * FROM users WHERE name = $1";
+    String expectedSQL =
+        "SELECT * FROM users WHERE name = $1 /*This is a comment*/ --this is another comment";
     String expectedMessageName = "some statement";
 
     DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(value));
@@ -368,7 +369,8 @@ public class ProtocolTest {
             parameters);
 
     int[] expectedParameterDataTypes = new int[] {0};
-    String expectedSQL = "SELECT * FROM users WHERE name = $1";
+    String expectedSQL =
+        "SELECT * FROM users WHERE name = $1 /*This is a comment*/ --this is another comment";
     String expectedMessageName = "some statement";
 
     DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(value));
@@ -419,7 +421,8 @@ public class ProtocolTest {
             messageMetadata, length, statementName.getBytes(), payload.getBytes(), intToBytes(0));
 
     int[] expectedParameterDataTypes = new int[0];
-    String expectedSQL = "SELECT * FROM users WHERE name = $1";
+    String expectedSQL =
+        "SELECT * FROM users WHERE name = $1 /*This is a comment*/ --this is another comment";
     String expectedMessageName = "some statement";
 
     DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(value));