Documentation ¶
Index ¶
Constants ¶
View Source
const (
DBCreatorPostgresOrder = iota
)
Variables ¶
View Source
var Module = &bootstrap.Module{ Name: "postgres-compatible", Precedence: bootstrap.DatabasePrecedence, Options: []fx.Option{ fx.Provide(NewGormDialetor, pqErrorTranslatorProvider(), newAnnotatedGormDbCreator(), ), }, }
Functions ¶
func NewGormDbCreator ¶
func NewGormDialetor ¶
func NewPqErrorTranslator ¶
func NewPqErrorTranslator() data.ErrorTranslator
Types ¶
type GormDialector ¶
func NewGormDialectorWithConfig ¶
func NewGormDialectorWithConfig(config postgres.Config) *GormDialector
type GormMigrator ¶
GormMigrator Inverted index support: for now, use PostgreSQL-compatible syntax: https://www.cockroachlabs.com/docs/v20.2/inverted-indexes#creation
func NewGormMigrator ¶
func NewGormMigrator(db *gorm.DB, dialector gorm.Dialector) *GormMigrator
type NoOpDbCreator ¶
type NoOpDbCreator struct{}
func (NoOpDbCreator) CreateDatabaseIfNotExist ¶
func (NoOpDbCreator) Order ¶
func (g NoOpDbCreator) Order() int
type PostgresErrorTranslator ¶
type PostgresErrorTranslator struct{}
PostgresErrorTranslator implements data.ErrorTranslator it translates pq.Error and pgconn.PgError to data.DataError Note: cockroach uses gorm.io/driver/postgres, which internally uses github.com/jackc/pgx Ref: - Postgres Error: https://www.postgresql.org/docs/11/protocol-error-fields.html - Postgres Error Code: https://www.postgresql.org/docs/11/errcodes-appendix.html
func (PostgresErrorTranslator) Order ¶
func (t PostgresErrorTranslator) Order() int
Source Files ¶
Click to show internal directories.
Click to hide internal directories.