Documentation ¶
Index ¶
- Constants
- Variables
- func AppendInParam(size int) string
- func Check(fieldOrTableName string) bool
- func CheckAndReplace(fieldOrTableName string) string
- func CheckEscape(fieldOrTableName string) bool
- func DeleteBuildUndoSql(undoLog sqlUndoLog) string
- func GetColumns(conn *Conn, dbName, tableName string) ([]schema.ColumnMeta, error)
- func GetIndexes(conn *Conn, dbName, tableName string) ([]schema.IndexMeta, error)
- func GetLastInsertId(id int64) string
- func GetSqlDataType(dataType string) int32
- func InitDataResourceManager()
- func InitTableMetaCache(dbName string)
- func InsertBuildUndoSql(undoLog sqlUndoLog) string
- func NewConnector(hosts ...string) driver.Connector
- func QueryEscape(s string) string
- func QueryUnescape(s string) (string, error)
- func RegisterResource(dsn string)
- func UpdateBuildUndoSql(undoLog sqlUndoLog) string
- type BuildUndoSql
- type Conn
- func (conn *Conn) Begin() (driver.Tx, error)
- func (conn *Conn) BeginTx(ctx context.Context, txOptions driver.TxOptions) (driver.Tx, error)
- func (conn *Conn) Close() error
- func (conn *Conn) Ping(ctx context.Context) error
- func (conn *Conn) Prepare(query string) (driver.Stmt, error)
- func (conn *Conn) PrepareContext(ctx context.Context, query string) (driver.Stmt, error)
- type Connector
- type DSN
- type DataSourceManager
- func (resourceManager DataSourceManager) BranchCommit(branchType meta.BranchType, xid string, branchID int64, resourceID string, ...) (meta.BranchStatus, error)
- func (resourceManager DataSourceManager) BranchRegister(branchType meta.BranchType, resourceID string, clientID string, xid string, ...) (int64, error)
- func (resourceManager DataSourceManager) BranchReport(branchType meta.BranchType, xid string, branchID int64, ...) error
- func (resourceManager DataSourceManager) BranchRollback(branchType meta.BranchType, xid string, branchID int64, resourceID string, ...) (meta.BranchStatus, error)
- func (resourceManager DataSourceManager) GetBranchType() meta.BranchType
- func (resourceManager DataSourceManager) LockQuery(branchType meta.BranchType, resourceID string, xid string, lockKeys string) (bool, error)
- type DriverStruct
- type EscapeError
- type OracleUndoExecutor
- type OracleUndoLogManager
- func (manager OracleUndoLogManager) BatchDeleteUndoLog(conn *Conn, xids []string, branchIDs []int64) error
- func (manager OracleUndoLogManager) DeleteUndoLog(conn *Conn, xid string, branchID int64) error
- func (manager OracleUndoLogManager) DeleteUndoLogByLogCreated(conn *Conn, logCreated time.Time, limitRows int) (sql.Result, error)
- func (manager OracleUndoLogManager) FlushUndoLogs(conn *Conn) error
- func (manager OracleUndoLogManager) Undo(conn *Conn, xid string, branchID int64, resourceID string) error
- type PbBranchUndoLog
- func (*PbBranchUndoLog) Descriptor() ([]byte, []int)
- func (m *PbBranchUndoLog) GetBranchID() int64
- func (m *PbBranchUndoLog) GetSqlUndoLogs() []*PbSqlUndoLog
- func (m *PbBranchUndoLog) GetXid() string
- func (*PbBranchUndoLog) ProtoMessage()
- func (m *PbBranchUndoLog) Reset()
- func (m *PbBranchUndoLog) String() string
- func (m *PbBranchUndoLog) XXX_DiscardUnknown()
- func (m *PbBranchUndoLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PbBranchUndoLog) XXX_Merge(src proto.Message)
- func (m *PbBranchUndoLog) XXX_Size() int
- func (m *PbBranchUndoLog) XXX_Unmarshal(b []byte) error
- type PbField
- func (*PbField) Descriptor() ([]byte, []int)
- func (m *PbField) GetKeyType() int32
- func (m *PbField) GetName() string
- func (m *PbField) GetType() int32
- func (m *PbField) GetValue() []byte
- func (*PbField) ProtoMessage()
- func (m *PbField) Reset()
- func (m *PbField) String() string
- func (m *PbField) XXX_DiscardUnknown()
- func (m *PbField) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PbField) XXX_Merge(src proto.Message)
- func (m *PbField) XXX_Size() int
- func (m *PbField) XXX_Unmarshal(b []byte) error
- type PbRow
- func (*PbRow) Descriptor() ([]byte, []int)
- func (m *PbRow) GetFields() []*PbField
- func (*PbRow) ProtoMessage()
- func (m *PbRow) Reset()
- func (m *PbRow) String() string
- func (m *PbRow) XXX_DiscardUnknown()
- func (m *PbRow) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PbRow) XXX_Merge(src proto.Message)
- func (m *PbRow) XXX_Size() int
- func (m *PbRow) XXX_Unmarshal(b []byte) error
- type PbSqlUndoLog
- func (*PbSqlUndoLog) Descriptor() ([]byte, []int)
- func (m *PbSqlUndoLog) GetAfterImage() *PbTableRecords
- func (m *PbSqlUndoLog) GetBeforeImage() *PbTableRecords
- func (m *PbSqlUndoLog) GetSqlType() int32
- func (m *PbSqlUndoLog) GetTableName() string
- func (*PbSqlUndoLog) ProtoMessage()
- func (m *PbSqlUndoLog) Reset()
- func (m *PbSqlUndoLog) String() string
- func (m *PbSqlUndoLog) XXX_DiscardUnknown()
- func (m *PbSqlUndoLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PbSqlUndoLog) XXX_Merge(src proto.Message)
- func (m *PbSqlUndoLog) XXX_Size() int
- func (m *PbSqlUndoLog) XXX_Unmarshal(b []byte) error
- type PbTableRecords
- func (*PbTableRecords) Descriptor() ([]byte, []int)
- func (m *PbTableRecords) GetRows() []*PbRow
- func (m *PbTableRecords) GetTableName() string
- func (*PbTableRecords) ProtoMessage()
- func (m *PbTableRecords) Reset()
- func (m *PbTableRecords) String() string
- func (m *PbTableRecords) XXX_DiscardUnknown()
- func (m *PbTableRecords) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PbTableRecords) XXX_Merge(src proto.Message)
- func (m *PbTableRecords) XXX_Size() int
- func (m *PbTableRecords) XXX_Unmarshal(b []byte) error
- type ProtoBufUndoLogParser
- type RawBytes
- type Result
- type Rows
- type SQLType
- type SqlDataType
- type State
- type Stmt
- type TableMetaCache
- func (cache *TableMetaCache) FetchSchema(conn *Conn, tableName string) (schema.TableMeta, error)
- func (cache *TableMetaCache) GetCacheKey(tableName string) string
- func (cache *TableMetaCache) GetTableMeta(conn *Conn, tableName string) (schema.TableMeta, error)
- func (cache *TableMetaCache) Refresh(conn *Conn, resourceID string)
- type Tx
- type UndoLogParser
- type Values
Constants ¶
const ( InsertSqlTemplate = "INSERT INTO %s (%s) VALUES (%s)" DeleteSqlTemplate = "DELETE FROM %s WHERE %s = :1" UpdateSqlTemplate = "UPDATE %s SET %s WHERE %s = :1" SelectSqlTemplate = "SELECT %s FROM %s WHERE %s IN %s" )
const ( DeleteUndoLogSql = "DELETE FROM undo_log WHERE xid = :1 and branch_id = :2" DeleteUndoLogByCreateSql = "DELETE FROM undo_log WHERE log_created <= :1 LIMIT :2" InsertUndoLogSql = "INSERT INTO UNDO_LOG (id, branch_id, xid, context, rollback_info, log_status, log_created, log_modified)" + "VALUES (UNDO_LOG_SEQ.NEXTVAL, :1, :2, :3, :4, :5, sysdate, sysdate)" SelectUndoLogSql = "SELECT branch_id, xid, context, rollback_info, log_status FROM undo_log " + "WHERE xid = :1 AND branch_id = :2" )
const ( BIT SqlDataType = -7 TINYINT = -6 SMALLINT = 5 INTEGER = 4 BIGINT = -5 FLOAT = 6 REAL = 7 DOUBLE = 8 NUMERIC = 2 DECIMAL = 3 CHAR = 1 VARCHAR = 12 LONGVARCHAR = -1 DATE = 91 TIME = 92 TIMESTAMP = 93 BINARY = -2 VARBINARY = -3 LONGVARBINARY = -4 NULL = 0 OTHER = 1111 JAVA_OBJECT = 2000 DISTINCT = 2001 STRUCT = 2002 ARRAY = 2003 BLOB = 2004 CLOB = 2005 REF = 2006 DATALINK = 70 BOOLEAN = 16 ROWID = -8 NCHAR = -15 NVARCHAR = -9 LONGNVARCHAR = -16 NCLOB = 2011 SQLXML = 2009 REF_CURSOR = 2012 TIME_WITH_TIMEZONE = 2013 TIMESTAMP_WITH_TIMEZONE = 2014 )
const XID = "XID"
Variables ¶
var ( // ErrOCIInvalidHandle is OCI_INVALID_HANDLE ErrOCIInvalidHandle = errors.New("OCI_INVALID_HANDLE") // ErrOCISuccessWithInfo is OCI_SUCCESS_WITH_INFO ErrOCISuccessWithInfo = errors.New("OCI_SUCCESS_WITH_INFO") // ErrOCIReservedForIntUse is OCI_RESERVED_FOR_INT_USE ErrOCIReservedForIntUse = errors.New("OCI_RESERVED_FOR_INT_USE") // ErrOCINoData is OCI_NO_DATA ErrOCINoData = errors.New("OCI_NO_DATA") // ErrOCINeedData is OCI_NEED_DATA ErrOCINeedData = errors.New("OCI_NEED_DATA") // ErrOCIStillExecuting is OCI_STILL_EXECUTING ErrOCIStillExecuting = errors.New("OCI_STILL_EXECUTING") // ErrNoRowid is result has no rowid ErrNoRowid = errors.New("result has no rowid") // Driver is the sql driver Driver = &DriverStruct{ Logger: log.New(ioutil.Discard, "", 0), } )
var (
DBKEYS_SPLIT_CHAR = ","
)
var EXPIRE_TIME = 15 * time.Minute
var ORACLEKeyword = map[string]string{}/* 110 elements not displayed */
110 key words
var SqlDataTypes = map[string]int32{
"BIT": -7,
"TINYINT": -6,
"SMALLINT": 5,
"INTEGER": 4,
"BIGINT": -5,
"FLOAT": 6,
"REAL": 7,
"DOUBLE": 8,
"NUMERIC": 2,
"DECIMAL": 3,
"CHAR": 1,
"VARCHAR": 12,
"LONGVARCHAR": -1,
"DATE": 91,
"TIME": 92,
"TIMESTAMP": 93,
"BINARY": -2,
"VARBINARY": -3,
"LONGVARBINARY": -4,
"NULL": 0,
"OTHER": 1111,
"JAVA_OBJECT": 2000,
"DISTINCT": 2001,
"STRUCT": 2002,
"ARRAY": 2003,
"BLOB": 2004,
"CLOB": 2005,
"REF": 2006,
"DATALINK": 70,
"BOOLEAN": 16,
"ROWID": -8,
"NCHAR": -15,
"NVARCHAR": -9,
"LONGNVARCHAR": -16,
"NCLOB": 2011,
"SQLXML": 2009,
"REF_CURSOR": 2012,
"TIME_WITH_TIMEZONE": 2013,
"TIMESTAMP_WITH_TIMEZONE": 2014,
}
Functions ¶
func AppendInParam ¶
func CheckAndReplace ¶
func CheckEscape ¶
func DeleteBuildUndoSql ¶
func DeleteBuildUndoSql(undoLog sqlUndoLog) string
func GetColumns ¶
func GetColumns(conn *Conn, dbName, tableName string) ([]schema.ColumnMeta, error)
func GetLastInsertId ¶
GetLastInsertId returns rowid from LastInsertId
func GetSqlDataType ¶
func InitDataResourceManager ¶
func InitDataResourceManager()
func InitTableMetaCache ¶
func InitTableMetaCache(dbName string)
func InsertBuildUndoSql ¶
func InsertBuildUndoSql(undoLog sqlUndoLog) string
func NewConnector ¶
NewConnector returns a new database connector
func QueryEscape ¶
QueryEscape escapes the string so it can be safely placed inside a URL query.
func QueryUnescape ¶
QueryUnescape does the inverse transformation of QueryEscape, converting %AB into the byte 0xAB and '+' into ' ' (space). It returns an error if any % is not followed by two hexadecimal digits.
func RegisterResource ¶
func RegisterResource(dsn string)
func UpdateBuildUndoSql ¶
func UpdateBuildUndoSql(undoLog sqlUndoLog) string
Types ¶
type BuildUndoSql ¶
type BuildUndoSql func(undoLog sqlUndoLog) string
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is Oracle connection
type Connector ¶
type Connector struct { // Logger is used to log connection ping errors Logger *log.Logger DSNstring string // contains filtered or unexported fields }
Connector is the sql driver connector
type DSN ¶
type DSN struct { Connect string Username string Password string // contains filtered or unexported fields }
DSN is Oracle Data Source Name
func ParseDSN ¶
ParseDSN parses a DSN used to connect to Oracle
It expects to receive a string in the form:
[username/[password]@]host[:port][/service_name][?param1=value1&...¶mN=valueN]
Connection timeout can be set in the Oracle files: sqlnet.ora as SQLNET.OUTBOUND_CONNECT_TIMEOUT or tnsnames.ora as CONNECT_TIMEOUT
Supported parameters are:
loc - the time location for reading timestamp (without time zone). Defaults to UTC Note that writing a timestamp (without time zone) just truncates the time zone.
isolation - the isolation level that can be set to: READONLY, SERIALIZABLE, or DEFAULT
prefetch_rows - the number of top level rows to be prefetched. Defaults to 0. A 0 means unlimited rows.
prefetch_memory - the max memory for top level rows to be prefetched. Defaults to 4096. A 0 means unlimited memory.
questionph - when true, enables question mark placeholders. Defaults to false. (uses strconv.ParseBool to check for true)
type DataSourceManager ¶
type DataSourceManager struct { RpcClient *rpc_client.RpcRemoteClient ResourceCache map[string]*Connector }
func (DataSourceManager) BranchCommit ¶
func (resourceManager DataSourceManager) BranchCommit(branchType meta.BranchType, xid string, branchID int64, resourceID string, applicationData []byte) (meta.BranchStatus, error)
func (DataSourceManager) BranchRegister ¶
func (resourceManager DataSourceManager) BranchRegister(branchType meta.BranchType, resourceID string, clientID string, xid string, applicationData []byte, lockKeys string) (int64, error)
func (DataSourceManager) BranchReport ¶
func (resourceManager DataSourceManager) BranchReport(branchType meta.BranchType, xid string, branchID int64, status meta.BranchStatus, applicationData []byte) error
func (DataSourceManager) BranchRollback ¶
func (resourceManager DataSourceManager) BranchRollback(branchType meta.BranchType, xid string, branchID int64, resourceID string, applicationData []byte) (meta.BranchStatus, error)
func (DataSourceManager) GetBranchType ¶
func (resourceManager DataSourceManager) GetBranchType() meta.BranchType
func (DataSourceManager) LockQuery ¶
func (resourceManager DataSourceManager) LockQuery(branchType meta.BranchType, resourceID string, xid string, lockKeys string) (bool, error)
type DriverStruct ¶
type DriverStruct struct { // Logger is used to log connection ping errors, defaults to discard // To log set it to something like: log.New(os.Stderr, "oci8 ", log.Ldate|log.Ltime|log.LUTC|log.Lshortfile) Logger *log.Logger }
DriverStruct is Oracle driver struct
type EscapeError ¶
type EscapeError string
EscapeError for invalid escape
func (EscapeError) Error ¶
func (e EscapeError) Error() string
Error returns string for invalid URL escape
type OracleUndoExecutor ¶
type OracleUndoExecutor struct {
// contains filtered or unexported fields
}
func NewOracleUndoExecutor ¶
func NewOracleUndoExecutor(undoLog sqlUndoLog) OracleUndoExecutor
func (OracleUndoExecutor) Execute ¶
func (executor OracleUndoExecutor) Execute(conn *Conn) error
type OracleUndoLogManager ¶ added in v0.1.2
type OracleUndoLogManager struct { }
func GetUndoLogManager ¶
func GetUndoLogManager() OracleUndoLogManager
func (OracleUndoLogManager) BatchDeleteUndoLog ¶ added in v0.1.2
func (manager OracleUndoLogManager) BatchDeleteUndoLog(conn *Conn, xids []string, branchIDs []int64) error
func (OracleUndoLogManager) DeleteUndoLog ¶ added in v0.1.2
func (manager OracleUndoLogManager) DeleteUndoLog(conn *Conn, xid string, branchID int64) error
func (OracleUndoLogManager) DeleteUndoLogByLogCreated ¶ added in v0.1.2
func (OracleUndoLogManager) FlushUndoLogs ¶ added in v0.1.2
func (manager OracleUndoLogManager) FlushUndoLogs(conn *Conn) error
type PbBranchUndoLog ¶
type PbBranchUndoLog struct { Xid string `protobuf:"bytes,1,opt,name=XID,proto3" json:"XID,omitempty"` BranchID int64 `protobuf:"varint,2,opt,name=BranchID,proto3" json:"BranchID,omitempty"` SqlUndoLogs []*PbSqlUndoLog `protobuf:"bytes,3,rep,name=SqlUndoLogs,proto3" json:"SqlUndoLogs,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PbBranchUndoLog) Descriptor ¶
func (*PbBranchUndoLog) Descriptor() ([]byte, []int)
func (*PbBranchUndoLog) GetBranchID ¶
func (m *PbBranchUndoLog) GetBranchID() int64
func (*PbBranchUndoLog) GetSqlUndoLogs ¶
func (m *PbBranchUndoLog) GetSqlUndoLogs() []*PbSqlUndoLog
func (*PbBranchUndoLog) GetXid ¶
func (m *PbBranchUndoLog) GetXid() string
func (*PbBranchUndoLog) ProtoMessage ¶
func (*PbBranchUndoLog) ProtoMessage()
func (*PbBranchUndoLog) Reset ¶
func (m *PbBranchUndoLog) Reset()
func (*PbBranchUndoLog) String ¶
func (m *PbBranchUndoLog) String() string
func (*PbBranchUndoLog) XXX_DiscardUnknown ¶
func (m *PbBranchUndoLog) XXX_DiscardUnknown()
func (*PbBranchUndoLog) XXX_Marshal ¶
func (m *PbBranchUndoLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PbBranchUndoLog) XXX_Merge ¶
func (m *PbBranchUndoLog) XXX_Merge(src proto.Message)
func (*PbBranchUndoLog) XXX_Size ¶
func (m *PbBranchUndoLog) XXX_Size() int
func (*PbBranchUndoLog) XXX_Unmarshal ¶
func (m *PbBranchUndoLog) XXX_Unmarshal(b []byte) error
type PbField ¶
type PbField struct { Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` KeyType int32 `protobuf:"varint,2,opt,name=KeyType,proto3" json:"KeyType,omitempty"` Type int32 `protobuf:"zigzag32,3,opt,name=Type,proto3" json:"Type,omitempty"` Value []byte `protobuf:"bytes,4,opt,name=Value,proto3" json:"Value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PbField) Descriptor ¶
func (*PbField) GetKeyType ¶
func (*PbField) ProtoMessage ¶
func (*PbField) ProtoMessage()
func (*PbField) XXX_DiscardUnknown ¶
func (m *PbField) XXX_DiscardUnknown()
func (*PbField) XXX_Marshal ¶
func (*PbField) XXX_Unmarshal ¶
type PbRow ¶
type PbRow struct { Fields []*PbField `protobuf:"bytes,1,rep,name=Fields,proto3" json:"Fields,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PbRow) Descriptor ¶
func (*PbRow) ProtoMessage ¶
func (*PbRow) ProtoMessage()
func (*PbRow) XXX_DiscardUnknown ¶
func (m *PbRow) XXX_DiscardUnknown()
func (*PbRow) XXX_Marshal ¶
func (*PbRow) XXX_Unmarshal ¶
type PbSqlUndoLog ¶
type PbSqlUndoLog struct { SqlType int32 `protobuf:"varint,1,opt,name=SqlType,proto3" json:"SqlType,omitempty"` TableName string `protobuf:"bytes,2,opt,name=TableName,proto3" json:"TableName,omitempty"` BeforeImage *PbTableRecords `protobuf:"bytes,3,opt,name=BeforeImage,proto3" json:"BeforeImage,omitempty"` AfterImage *PbTableRecords `protobuf:"bytes,4,opt,name=AfterImage,proto3" json:"AfterImage,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PbSqlUndoLog) Descriptor ¶
func (*PbSqlUndoLog) Descriptor() ([]byte, []int)
func (*PbSqlUndoLog) GetAfterImage ¶
func (m *PbSqlUndoLog) GetAfterImage() *PbTableRecords
func (*PbSqlUndoLog) GetBeforeImage ¶
func (m *PbSqlUndoLog) GetBeforeImage() *PbTableRecords
func (*PbSqlUndoLog) GetSqlType ¶
func (m *PbSqlUndoLog) GetSqlType() int32
func (*PbSqlUndoLog) GetTableName ¶
func (m *PbSqlUndoLog) GetTableName() string
func (*PbSqlUndoLog) ProtoMessage ¶
func (*PbSqlUndoLog) ProtoMessage()
func (*PbSqlUndoLog) Reset ¶
func (m *PbSqlUndoLog) Reset()
func (*PbSqlUndoLog) String ¶
func (m *PbSqlUndoLog) String() string
func (*PbSqlUndoLog) XXX_DiscardUnknown ¶
func (m *PbSqlUndoLog) XXX_DiscardUnknown()
func (*PbSqlUndoLog) XXX_Marshal ¶
func (m *PbSqlUndoLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PbSqlUndoLog) XXX_Merge ¶
func (m *PbSqlUndoLog) XXX_Merge(src proto.Message)
func (*PbSqlUndoLog) XXX_Size ¶
func (m *PbSqlUndoLog) XXX_Size() int
func (*PbSqlUndoLog) XXX_Unmarshal ¶
func (m *PbSqlUndoLog) XXX_Unmarshal(b []byte) error
type PbTableRecords ¶
type PbTableRecords struct { TableName string `protobuf:"bytes,1,opt,name=TableName,proto3" json:"TableName,omitempty"` Rows []*PbRow `protobuf:"bytes,2,rep,name=Rows,proto3" json:"Rows,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PbTableRecords) Descriptor ¶
func (*PbTableRecords) Descriptor() ([]byte, []int)
func (*PbTableRecords) GetRows ¶
func (m *PbTableRecords) GetRows() []*PbRow
func (*PbTableRecords) GetTableName ¶
func (m *PbTableRecords) GetTableName() string
func (*PbTableRecords) ProtoMessage ¶
func (*PbTableRecords) ProtoMessage()
func (*PbTableRecords) Reset ¶
func (m *PbTableRecords) Reset()
func (*PbTableRecords) String ¶
func (m *PbTableRecords) String() string
func (*PbTableRecords) XXX_DiscardUnknown ¶
func (m *PbTableRecords) XXX_DiscardUnknown()
func (*PbTableRecords) XXX_Marshal ¶
func (m *PbTableRecords) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PbTableRecords) XXX_Merge ¶
func (m *PbTableRecords) XXX_Merge(src proto.Message)
func (*PbTableRecords) XXX_Size ¶
func (m *PbTableRecords) XXX_Size() int
func (*PbTableRecords) XXX_Unmarshal ¶
func (m *PbTableRecords) XXX_Unmarshal(b []byte) error
type ProtoBufUndoLogParser ¶
type ProtoBufUndoLogParser struct { }
func (ProtoBufUndoLogParser) Decode ¶
func (parser ProtoBufUndoLogParser) Decode(data []byte) *branchUndoLog
func (ProtoBufUndoLogParser) Encode ¶
func (parser ProtoBufUndoLogParser) Encode(branchUndoLog *branchUndoLog) []byte
func (ProtoBufUndoLogParser) GetDefaultContent ¶
func (parser ProtoBufUndoLogParser) GetDefaultContent() []byte
func (ProtoBufUndoLogParser) GetName ¶
func (parser ProtoBufUndoLogParser) GetName() string
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result is Oracle result
func (*Result) LastInsertId ¶
LastInsertId returns last inserted ID
func (*Result) RowsAffected ¶
RowsAffected returns rows affected
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
Rows is Oracle rows
func (*Rows) ColumnTypeDatabaseTypeName ¶
ColumnTypeDatabaseTypeName implement RowsColumnTypeDatabaseTypeName.
func (*Rows) ColumnTypeLength ¶
ColumnTypeLength is returning OCI_ATTR_DATA_SIZE, which is max data size in bytes. Note this is not returing length of the column type, like the 20 in FLOAT(20), which is what is normally expected. TODO: Should / can it be changed to return length of the column type?
func (*Rows) ColumnTypeScanType ¶
ColumnTypeScanType implement RowsColumnTypeScanType.
type SQLType ¶
type SQLType byte
const ( SQLType_SELECT SQLType = iota SQLType_INSERT SQLType_UPDATE SQLType_DELETE SQLType_SELECT_FOR_UPDATE SQLType_REPLACE SQLType_TRUNCATE SQLType_CREATE SQLType_DROP SQLType_LOAD SQLType_MERGE SQLType_SHOW SQLType_ALTER SQLType_RENAME SQLType_DUMP SQLType_DEBUG SQLType_EXPLAIN SQLType_PROCEDURE SQLType_DESC SQLType_SET SQLType = 27 SQLType_RELOAD SQLType = 28 SQLType_SELECT_UNION SQLType = 29 SQLType_CREATE_TABLE SQLType = 30 SQLType_DROP_TABLE SQLType = 31 SQLType_ALTER_TABLE SQLType = 32 SQLType_SAVE_POINT SQLType = 33 SQLType_SELECT_FROM_UPDATE SQLType = 34 SQLType_MULTI_DELETE SQLType = 35 SQLType_MULTI_UPDATE SQLType = 36 SQLType_CREATE_INDEX SQLType = 37 SQLType_DROP_INDEX SQLType = 38 )
type SqlDataType ¶
type SqlDataType int32
type Stmt ¶
type Stmt struct {
// contains filtered or unexported fields
}
Stmt is Oracle statement
func (*Stmt) CheckNamedValue ¶
func (stmt *Stmt) CheckNamedValue(namedValue *driver.NamedValue) error
CheckNamedValue checks a named value
type TableMetaCache ¶
type TableMetaCache struct {
// contains filtered or unexported fields
}
func GetTableMetaCache ¶
func GetTableMetaCache(dbName string) (*TableMetaCache, error)
func (*TableMetaCache) FetchSchema ¶
func (*TableMetaCache) GetCacheKey ¶
func (cache *TableMetaCache) GetCacheKey(tableName string) string
func (*TableMetaCache) GetTableMeta ¶
func (*TableMetaCache) Refresh ¶
func (cache *TableMetaCache) Refresh(conn *Conn, resourceID string)
type UndoLogParser ¶
type UndoLogParser interface { GetName() string // return the default content if undo log is empty GetDefaultContent() []byte Encode(branchUndoLog *branchUndoLog) []byte Decode(data []byte) *branchUndoLog }
func GetUndoLogParser ¶
func GetUndoLogParser() UndoLogParser
type Values ¶
Values maps a string key to a list of values. It is typically used for query parameters and form values. Unlike in the http.Header map, the keys in a Values map are case-sensitive.
func ParseQuery ¶
ParseQuery parses the URL-encoded query string and returns a map listing the values specified for each key. ParseQuery always returns a non-nil map containing all the valid query parameters found; err describes the first decoding error encountered, if any.
func (Values) Add ¶
Add adds the value to key. It appends to any existing values associated with key.
func (Values) Encode ¶
Encode encodes the values into “URL encoded” form ("bar=baz&foo=quux") not sorted by key
Source Files ¶
- OracleParser.go
- Oracle_undo_executor.go
- c_helpers.go
- connection.go
- connector.go
- datasource_manager.go
- dsn.go
- executor.go
- globals.go
- oci8.go
- oracle_keyword_checker.go
- oracle_undo_log_manager.go
- protobuf_undo_log_parser.go
- rows.go
- sql_data_type.go
- sql_type.go
- statement.go
- table_meta_cache.go
- table_records.pb.go
- transaction.go
- undo_log.go
- undo_log.pb.go
- undo_log_parser.go
- utils.go