Documentation
¶
Index ¶
- Constants
- func AutoOrderBy(db *gorm.DB)
- func BeforeUpdate(db *gorm.DB)
- func New(config postgres.Config) gorm.Dialector
- func NewWithSpannerConfig(config postgres.Config, spannerConfig SpannerConfig) gorm.Dialector
- func Open(dsn string) gorm.Dialector
- type Dialector
- func (dialector Dialector) ClauseBuilders() map[string]clause.ClauseBuilder
- func (dialector Dialector) DataTypeOf(field *schema.Field) string
- func (dialector Dialector) Initialize(db *gorm.DB) (err error)
- func (dialector Dialector) Migrator(db *gorm.DB) gorm.Migrator
- func (dialector Dialector) Name() string
- type SpannerConfig
Constants ¶
View Source
const ( // ClauseOnConflict for clause.ClauseBuilder ON CONFLICT key ClauseOnConflict = "ON CONFLICT" // ClauseLimit for clause.ClauseBuilder LIMIT key ClauseLimit = "LIMIT" )
Variables ¶
This section is empty.
Functions ¶
func AutoOrderBy ¶
func BeforeUpdate ¶
func NewWithSpannerConfig ¶
func NewWithSpannerConfig(config postgres.Config, spannerConfig SpannerConfig) gorm.Dialector
Types ¶
type Dialector ¶
type Dialector struct {
postgres.Dialector
SpannerConfig SpannerConfig
}
func (Dialector) ClauseBuilders ¶
func (dialector Dialector) ClauseBuilders() map[string]clause.ClauseBuilder
type SpannerConfig ¶
type SpannerConfig struct {
// DisableAutoMigrateBatching turns off DDL batching for AutoMigrate calls.
// Spanner PostgreSQL by default uses DDL batching when AutoMigrate is called, as
// executing multiple DDL statements in a single batch is a lot more efficient
// than executing each statement separately. You should only use this option
// if you are experiencing problems with the automatic batching of DDL
// statements when calling AutoMigrate.
DisableAutoMigrateBatching bool
// AutoOrderByPk automatically adds an ORDER BY <pk> to all queries.
// This flag is primarily intended for testing, as most gorm tests assume that queries will return query results
// in primary key order, even when there is no ORDER BY clause in the query. Spanner does not guarantee this.
AutoOrderByPk bool
// AutoAddPrimaryKey automatically adds a 'generated_id serial' column to tables that are created without a
// primary key. This flag is primarily intended for testing, as some gorm tests assumes that databases support
// tables without a primary key. Spanner does not support this.
AutoAddPrimaryKey bool
}
SpannerConfig contains custom configuration options for Spanner PostgreSQL.
Click to show internal directories.
Click to hide internal directories.