Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteTempTable(name string)
- func EndStatement(baseData *StatementBaseData) error
- func EndTransaction(conn *GoSqlConnData, newState TransactionState) error
- func InitTransaction(conn *GoSqlConnData)
- func InitTransactionManager()
- func NewTransactionManager() *transactionManagerType
- func StartTransaction(c *GoSqlConnData) error
- type BaseStatement
- type BaseTable
- type GoSqlColumn
- type GoSqlConnData
- type GoSqlIdentifier
- type GoSqlTable
- func (t *GoSqlTable) Data() *[][]driver.Value
- func (t *GoSqlTable) Delete(recordId int64, conn *GoSqlConnData) bool
- func (t *GoSqlTable) Increment(columnName string) int64
- func (t *GoSqlTable) Insert(recordValues []driver.Value, conn *GoSqlConnData) int64
- func (t *GoSqlTable) NewIterator(baseData *StatementBaseData, forChange bool) TableIterator
- func (t *GoSqlTable) Update(recordId int64, recordValues Tuple, conn *GoSqlConnData) bool
- type GoSqlTableIterator
- type SliceTuple
- func (t *SliceTuple) Clone() Tuple
- func (t *SliceTuple) Data(tableIx int, ix int) (driver.Value, error)
- func (t *SliceTuple) DataLen() int
- func (t *SliceTuple) Id() int64
- func (t *SliceTuple) SafeData(tableIx int, ix int) driver.Value
- func (t *SliceTuple) SetData(tableIx int, ix int, val driver.Value) error
- type SnapShot
- type StatementBaseData
- type StatementInterface
- type StmtState
- type Table
- type TableIterator
- type TempTable
- func (t *TempTable) Data() *[][]driver.Value
- func (t *TempTable) Delete(recordId int64, conn *GoSqlConnData) bool
- func (t *TempTable) Insert(recordValues []driver.Value, conn *GoSqlConnData) int64
- func (t *TempTable) NewIterator(baseData *StatementBaseData, forChange bool) TableIterator
- func (t *TempTable) Update(recordId int64, recordValues Tuple, conn *GoSqlConnData) bool
- type TempTableData
- type TempTableIterator
- type Transaction
- type TransactionIsolationLevel
- type TransactionState
- type Tuple
- type TupleVersion
- type VersionedTuple
Constants ¶
View Source
const ( PRIMARY_AUTOINCREMENT = 1 DEFAULT_MAX_LENGTH = 40 DEFAULT_SCHEMA_NAME = "%%DEFAULTSCHEMA%%" )
View Source
const (
FOR_UPDATE_FLAG = 1
)
View Source
const NO_TRANSACTION = int64(0)
Variables ¶
View Source
var ErrDoWaitForTra = errors.New("WaitforTra")
View Source
var ErrTraLockTimeout = errors.New("transaction Lock Timeout elapsed")
View Source
var ErrTraSerialization = errors.New("SerializationError")
View Source
var NULL_TUPLE = &SliceTuple{-1, nil}
View Source
var (
Schemas = make(map[string]map[string]Table)
)
View Source
var (
VersionedRecordId = "VersionedRecordIdentifier"
)
Functions ¶
func DeleteTempTable ¶
func DeleteTempTable(name string)
func EndStatement ¶
func EndStatement(baseData *StatementBaseData) error
func EndTransaction ¶
func EndTransaction(conn *GoSqlConnData, newState TransactionState) error
func InitTransaction ¶
func InitTransaction(conn *GoSqlConnData)
func InitTransactionManager ¶
func InitTransactionManager()
func NewTransactionManager ¶
func NewTransactionManager() *transactionManagerType
func StartTransaction ¶
func StartTransaction(c *GoSqlConnData) error
called during any change after transaction begin (or after last commit/rollback in case of autocommit)
Types ¶
type BaseStatement ¶
type BaseStatement struct {
StatementBaseData
}
func NewStatementBaseData ¶
func NewStatementBaseData() BaseStatement
func (*BaseStatement) BaseData ¶
func (s *BaseStatement) BaseData() *StatementBaseData
type BaseTable ¶
type BaseTable struct { SchemaName string TableName string TableColumns []GoSqlColumn }
func (*BaseTable) Columns ¶
func (t *BaseTable) Columns() []GoSqlColumn
type GoSqlColumn ¶
type GoSqlConnData ¶
type GoSqlConnData struct { Number int64 Transaction *Transaction DoAutoCommit bool DefaultIsolationLevel TransactionIsolationLevel CurrentSchema string }
type GoSqlIdentifier ¶
type GoSqlIdentifier struct {
Parts []string
}
func (GoSqlIdentifier) Name ¶
func (i GoSqlIdentifier) Name() string
type GoSqlTable ¶
type GoSqlTable struct { BaseTable NextTupleId atomic.Int64 // contains filtered or unexported fields }
func NewTable ¶
func NewTable(name GoSqlIdentifier, columns []GoSqlColumn) *GoSqlTable
func (*GoSqlTable) Data ¶
func (t *GoSqlTable) Data() *[][]driver.Value
func (*GoSqlTable) Delete ¶
func (t *GoSqlTable) Delete(recordId int64, conn *GoSqlConnData) bool
func (*GoSqlTable) Increment ¶
func (t *GoSqlTable) Increment(columnName string) int64
func (*GoSqlTable) Insert ¶
func (t *GoSqlTable) Insert(recordValues []driver.Value, conn *GoSqlConnData) int64
func (*GoSqlTable) NewIterator ¶
func (t *GoSqlTable) NewIterator(baseData *StatementBaseData, forChange bool) TableIterator
func (*GoSqlTable) Update ¶
func (t *GoSqlTable) Update(recordId int64, recordValues Tuple, conn *GoSqlConnData) bool
type GoSqlTableIterator ¶
type GoSqlTableIterator struct { Transaction *Transaction SnapShot *SnapShot // contains filtered or unexported fields }
func (*GoSqlTableIterator) GetTable ¶
func (tIt *GoSqlTableIterator) GetTable() Table
type SliceTuple ¶
type SliceTuple struct {
// contains filtered or unexported fields
}
func (*SliceTuple) Clone ¶
func (t *SliceTuple) Clone() Tuple
func (*SliceTuple) DataLen ¶
func (t *SliceTuple) DataLen() int
func (*SliceTuple) Id ¶
func (t *SliceTuple) Id() int64
type SnapShot ¶
type SnapShot struct { Cid int32 // contains filtered or unexported fields }
func GetSnapShot ¶
func GetSnapShot(transaction *Transaction) *SnapShot
func (*SnapShot) RunningIds ¶
type StatementBaseData ¶
type StatementBaseData struct { Conn *GoSqlConnData SnapShot *SnapShot State StmtState }
func (*StatementBaseData) Close ¶
func (r *StatementBaseData) Close() error
func (*StatementBaseData) NumInput ¶
func (r *StatementBaseData) NumInput() int
type StatementInterface ¶
type StatementInterface interface { driver.Stmt BaseData() *StatementBaseData }
type Table ¶
type Table interface { Schema() string Name() string Columns() []GoSqlColumn Data() *[][]driver.Value NewIterator(baseData *StatementBaseData, forChange bool) TableIterator FindColumn(name string) (int, error) Insert(recordValues []driver.Value, conn *GoSqlConnData) int64 Update(recordId int64, recordValues Tuple, conn *GoSqlConnData) bool Delete(recordId int64, conn *GoSqlConnData) bool }
func GetTable ¶
func GetTable(stmt BaseStatement, id GoSqlIdentifier) (Table, bool)
func GetTempTable ¶
func NewTempTable ¶
func NewTempTable(columns []GoSqlColumn) Table
type TableIterator ¶
type TempTable ¶
func (*TempTable) Insert ¶
func (t *TempTable) Insert(recordValues []driver.Value, conn *GoSqlConnData) int64
func (*TempTable) NewIterator ¶
func (t *TempTable) NewIterator(baseData *StatementBaseData, forChange bool) TableIterator
type TempTableData ¶
type TempTableData struct {
// contains filtered or unexported fields
}
type TempTableIterator ¶
type TempTableIterator struct {
// contains filtered or unexported fields
}
func (*TempTableIterator) GetTable ¶
func (tIt *TempTableIterator) GetTable() Table
type Transaction ¶
type Transaction struct { Xid int64 Cid int32 Started int64 Ended int64 ChangeCount int64 MaxLockTimeInMs int64 SnapShot *SnapShot State TransactionState IsolationLevel TransactionIsolationLevel Conn *GoSqlConnData }
func GetTransaction ¶
func GetTransaction(xid int64) (*Transaction, error)
func (*Transaction) Commit ¶
func (t *Transaction) Commit() error
func (*Transaction) IsStarted ¶
func (t *Transaction) IsStarted() bool
func (*Transaction) Rollback ¶
func (t *Transaction) Rollback() error
func (*Transaction) SetRollbackOnly ¶
func (t *Transaction) SetRollbackOnly() error
type TransactionIsolationLevel ¶
type TransactionIsolationLevel int8
const ( UNCOMMITTED_READ TransactionIsolationLevel = iota + 1 COMMITTED_READ REPEATABLE_READ SERIALIZABLE )
type TransactionState ¶
type TransactionState int8
const ( INITED TransactionState = iota + 1 STARTED ROLLBACKONLY COMMITTED ROLLEDBACK )
type Tuple ¶
type TupleVersion ¶
type VersionedTuple ¶
type VersionedTuple struct { Versions []TupleVersion // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.