summaryrefslogtreecommitdiff
path: root/vendor/github.com/testcontainers/testcontainers-go/modules/postgres/options.go
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-08-14 11:54:52 -0600
committermo khan <mo@mokhan.ca>2025-08-14 11:54:52 -0600
commit9e55e65ac5eb6ff645880ee253a33f6ab138b615 (patch)
tree3a55344b8c589f52687200c0beb5cd92688014fa /vendor/github.com/testcontainers/testcontainers-go/modules/postgres/options.go
parent3f228b16c758d377566f11d2d328d1ccf658a2ad (diff)
Fix the broken build by running pg as a separate container.
Improve shell scripts and remove /sparkles/restore endpoint - Add error handling and debugging to shell scripts with `set -e` and `DEBUG` flag - Ensure scripts run from project root with `cd "$(dirname "$0")/.."` - Remove `/sparkles/restore` endpoint from public routes and Envoy config - Add Postgres test container support for integration tests - Update CI configuration with newer Runway version and improved test setup - Simplify Makefile by removing redundant commands ------- :robot: Commit message generated by GitLab Duo
Diffstat (limited to 'vendor/github.com/testcontainers/testcontainers-go/modules/postgres/options.go')
-rw-r--r--vendor/github.com/testcontainers/testcontainers-go/modules/postgres/options.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/vendor/github.com/testcontainers/testcontainers-go/modules/postgres/options.go b/vendor/github.com/testcontainers/testcontainers-go/modules/postgres/options.go
new file mode 100644
index 0000000..5779f85
--- /dev/null
+++ b/vendor/github.com/testcontainers/testcontainers-go/modules/postgres/options.go
@@ -0,0 +1,39 @@
+package postgres
+
+import (
+ "github.com/testcontainers/testcontainers-go"
+)
+
+type options struct {
+ // SQLDriverName is the name of the SQL driver to use.
+ SQLDriverName string
+ Snapshot string
+}
+
+func defaultOptions() options {
+ return options{
+ SQLDriverName: "postgres",
+ Snapshot: defaultSnapshotName,
+ }
+}
+
+// Compiler check to ensure that Option implements the testcontainers.ContainerCustomizer interface.
+var _ testcontainers.ContainerCustomizer = (Option)(nil)
+
+// Option is an option for the Redpanda container.
+type Option func(*options)
+
+// Customize is a NOOP. It's defined to satisfy the testcontainers.ContainerCustomizer interface.
+func (o Option) Customize(*testcontainers.GenericContainerRequest) error {
+ // NOOP to satisfy interface.
+ return nil
+}
+
+// WithSQLDriver sets the SQL driver to use for the container.
+// It is passed to sql.Open() to connect to the database when making or restoring snapshots.
+// This can be set if your app imports a different postgres driver, f.ex. "pgx"
+func WithSQLDriver(driver string) Option {
+ return func(o *options) {
+ o.SQLDriverName = driver
+ }
+}