Documentation ¶
Index ¶
- Constants
- Variables
- func CheckTarantoolTables(tConn *Adapter, tables map[TableName]*TableProp)
- func Connect1(host, port, user, pass string) *tarantool.Connection
- func Descr(args ...any)
- func GenerateOrm(tables map[TableName]*TableProp, withGraphql ...bool)
- func TypeGraphql(field Field) string
- type Adapter
- func (a *Adapter) CallBoxSpace(funcName string, params A.X) (rows [][]any)
- func (a *Adapter) CreateSpace(tableName string, engine EngineType) bool
- func (a *Adapter) DropTable(tableName string) bool
- func (a *Adapter) ExecBoxSpace(funcName string, params A.X) bool
- func (a *Adapter) ExecBoxSpaceVerbose(funcName string, params A.X) string
- func (a *Adapter) ExecSql(query string, parameters ...MSX) map[any]any
- func (a *Adapter) ExecTarantool(funcName string, params A.X) bool
- func (a *Adapter) ExecTarantoolVerbose(funcName string, params A.X) string
- func (a *Adapter) MigrateTables(tables map[TableName]*TableProp)
- func (a *Adapter) QuerySql(query string, callback func(row []any), parameters ...MSX) []any
- func (a *Adapter) ReformatTable(tableName string, fields []Field) bool
- func (a *Adapter) RetryDo(op tarantool.Request, times ...int) ([]any, error)
- func (a *Adapter) RetryDoResp(op tarantool.Request, times ...int) (tarantool.Response, error)
- func (a *Adapter) TruncateTable(tableName string) bool
- func (a *Adapter) UpsertTable(tableName TableName, prop *TableProp) bool
- type DataType
- type EngineType
- type Field
- type Index
- type MSX
- type NullableField
- type QueryMeta
- type TableName
- type TableProp
- type TtDockerTest
Constants ¶
View Source
const BoxSpacePrefix = `box.space.`
View Source
const Engine = `engine`
misc
View Source
const IdCol = `id`
View Source
const IfNotExists = `if_not_exists`
View Source
const NL = "\n"
Variables ¶
View Source
var DEBUG = false
View Source
var DebugPerf = false
View Source
var ErrMiscaonfiguration = errors.New(`misconfiguration`)
View Source
var MIGRATION_QUEUE = 1000
View Source
var MIGRATION_REC_PER_BATCH = uint64(20_000)
View Source
var MIGRATION_THREAD = 8
View Source
var Type2TarantoolDefault = map[DataType]string{ Unsigned: `0`, String: `''`, Integer: `0`, Boolean: `false`, Double: `0`, Array: `[]`, }
View Source
var TypeToConst = map[DataType]string{ Unsigned: `Tt.Unsigned`, String: `Tt.String`, Integer: `Tt.Integer`, Double: `Tt.Double`, Boolean: `Tt.Boolean`, Array: `Tt.Array`, }
View Source
var TypeToConvertFunc = map[DataType]string{ Unsigned: `X.ToU`, String: `X.ToS`, Integer: `X.ToI`, Double: `X.ToF`, Boolean: `X.ToBool`, Array: `X.ToArr`, }
View Source
var TypeToGoEmptyValue = map[DataType]string{ Unsigned: `0`, String: "``", Integer: `0`, Double: `0`, Boolean: `false`, Array: `[]any{}`, }
Functions ¶
func CheckTarantoolTables ¶
func Connect1 ¶
func Connect1(host, port, user, pass string) *tarantool.Connection
Connect1 is example of connect function to connect on terminal locally, use: tarantoolctl connect user:password@localhost:3301
func GenerateOrm ¶
func TypeGraphql ¶
Types ¶
type Adapter ¶
type Adapter struct { *tarantool.Connection Reconnect func() *tarantool.Connection }
func NewAdapter ¶
func NewAdapter(connectFunc func() *tarantool.Connection) *Adapter
NewAdapter create new tarantool adapter adapter contains helper methods for schema manipulation and query execution
func (*Adapter) CallBoxSpace ¶
CallBoxSpace ignore return value
func (*Adapter) CreateSpace ¶
func (a *Adapter) CreateSpace(tableName string, engine EngineType) bool
func (*Adapter) ExecBoxSpace ¶
ignore return value
func (*Adapter) ExecBoxSpaceVerbose ¶
func (*Adapter) ExecTarantool ¶
ignore return value
func (*Adapter) ExecTarantoolVerbose ¶
func (*Adapter) MigrateTables ¶
func (*Adapter) ReformatTable ¶
func (*Adapter) RetryDoResp ¶ added in v1.4131.654
func (*Adapter) TruncateTable ¶
type EngineType ¶
type EngineType string
const ( Vinyl EngineType = `vinyl` Memtx EngineType = `memtx` )
type Field ¶
func (Field) KeyRenderer ¶ added in v1.4131.654
type NullableField ¶
type QueryMeta ¶
type QueryMeta struct { Columns []tarantool.ColumnMetaData SqlInfo tarantool.SQLInfo Err string Code uint32 }
func QueryMetaFrom ¶
type TableProp ¶
type TableProp struct { Fields []Field // indexes Unique1 string Unique2 string Unique3 string Uniques []string // multicolumn unique Indexes []string Spatial string Engine EngineType HiddenFields []string AutoIncrementId bool // "id" column will be used to generate sequence, can only be created at beginning GenGraphqlType bool // hook PreReformatMigrationHook func(*Adapter) PreUnique1MigrationHook func(*Adapter) PreUnique2MigrationHook func(*Adapter) PreUnique3MigrationHook func(*Adapter) PreUniquesMigrationHook func(*Adapter) PreSpatialMigrationHook func(*Adapter) AutoCensorFields []string // fields to automatically censor }
type TtDockerTest ¶
type TtDockerTest struct { User string Password string Image string Port string // contains filtered or unexported fields }
func (*TtDockerTest) ConnectCheck ¶
func (in *TtDockerTest) ConnectCheck(res *dockertest.Resource) (taran *tarantool.Connection, err error)
func (*TtDockerTest) ImageVersion ¶
func (in *TtDockerTest) ImageVersion(pool *D.DockerTest, version string) *dockertest.RunOptions
ImageVersion https://hub.docker.com/r/tarantool/tarantool
tarantoolctl connect 3301
func (*TtDockerTest) SetDefaults ¶
func (in *TtDockerTest) SetDefaults(img string)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.