Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ module github.com/conductorone/baton-postgresql
go 1.23.4

require (
github.com/conductorone/baton-sdk v0.2.93
github.com/conductorone/baton-sdk v0.3.10
github.com/ennyjfrick/ruleguard-logfatal v0.0.2
github.com/georgysavva/scany v1.2.2
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/jackc/pgconn v1.14.3
github.com/jackc/pgx/v4 v4.18.3
github.com/quasilyte/go-ruleguard/dsl v0.3.22
github.com/spf13/viper v1.19.0
go.uber.org/zap v1.27.0
)

Expand Down Expand Up @@ -91,6 +90,7 @@ require (
github.com/spf13/cast v1.7.1 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/spf13/viper v1.19.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
github.com/tklauser/numcpus v0.9.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
github.com/cockroachdb/cockroach-go/v2 v2.2.0 h1:/5znzg5n373N/3ESjHF5SMLxiW4RKB05Ql//KWfeTFs=
github.com/cockroachdb/cockroach-go/v2 v2.2.0/go.mod h1:u3MiKYGupPPjkn3ozknpMUpxPaNLTFWAya419/zv6eI=
github.com/conductorone/baton-sdk v0.2.93 h1:zAj0CdZ0T9EcwDD0S26QBOJABp9KR8em4G5LCj3CSbw=
github.com/conductorone/baton-sdk v0.2.93/go.mod h1:nUgHSAf9P0lfamti5NlOSpeh1t99UNzMjIwf0I7n4/g=
github.com/conductorone/baton-sdk v0.3.10 h1:e1J0Y2knHTbzn9bAsjElmhv5lRpYwI6ixw0Ak+gx0JY=
github.com/conductorone/baton-sdk v0.3.10/go.mod h1:lWZHgu025Rsgs5jvBrhilGti0zWF2+YfaFY/bWOS/g0=
github.com/conductorone/dpop v0.2.3 h1:s91U3845GHQ6P6FWrdNr2SEOy1ES/jcFs1JtKSl2S+o=
github.com/conductorone/dpop v0.2.3/go.mod h1:gyo8TtzB9SCFCsjsICH4IaLZ7y64CcrDXMOPBwfq/3s=
github.com/conductorone/dpop/integrations/dpop_grpc v0.2.3 h1:kLMCNIh0Mo2vbvvkCmJ3ixsPbXEJ6HPcW53Ku9yje3s=
Expand Down
50 changes: 40 additions & 10 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,46 @@ import (
)

var (
dsn = field.StringField("dsn", field.WithRequired(true), field.WithDescription("The DSN to connect to the database"))
schemas = field.StringSliceField("schemas", field.WithDefaultValue([]string{"public"}), field.WithDescription("The schemas to include in the sync"))
includeColumns = field.BoolField("include-columns", field.WithDescription("Include column privileges when syncing. This can result in large amounts of data"))
includeLargeObjects = field.BoolField("include-large-objects", field.WithDescription("Include large objects when syncing. This can result in large amounts of data"))
syncAllDatabases = field.BoolField("sync-all-databases", field.WithDescription("Sync all databases. This can result in large amounts of data"), field.WithDefaultValue(false))
dsn = field.StringField(
"dsn",
field.WithDisplayName("DSN"),
field.WithRequired(true),
field.WithDescription("The DSN to connect to the database"),
field.WithIsSecret(true),
)
schemas = field.StringSliceField(
"schemas",
field.WithDisplayName("Schemas"),
field.WithDefaultValue([]string{"public"}),
field.WithDescription("The schemas to include in the sync"),
)
includeColumns = field.BoolField(
"include-columns",
field.WithDisplayName("Include Columns"),
field.WithDescription("Include column privileges when syncing. This can result in large amounts of data"),
)
includeLargeObjects = field.BoolField(
"include-large-objects",
field.WithDisplayName("Include Large Objects"),
field.WithDescription("Include large objects when syncing. This can result in large amounts of data"),
)
syncAllDatabases = field.BoolField(
"sync-all-databases",
field.WithDisplayName("Sync All Databases"),
field.WithDescription("Sync all databases. This can result in large amounts of data"),
field.WithDefaultValue(false),
)
)

var relationships = []field.SchemaFieldRelationship{}

//go:generate go run ./gen
var Config = field.NewConfiguration([]field.SchemaField{
dsn, schemas, includeColumns, includeLargeObjects, syncAllDatabases,
}, relationships...)
var Config = field.NewConfiguration(
[]field.SchemaField{
dsn,
schemas,
includeColumns,
includeLargeObjects,
syncAllDatabases,
},
field.WithConnectorDisplayName("PostgreSQL"),
field.WithHelpUrl("/docs/baton/postgresql"),
)

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading