Connection property names
const ( ConnectionPropertyDoubleConnectWaitTime string = C.TIBDG_CONNECTION_PROPERTY_DOUBLE_CONNECT_WAIT_TIME ConnectionPropertyDoubleTimeout string = C.TIBDG_CONNECTION_PROPERTY_DOUBLE_TIMEOUT ConnectionPropertyLongBindStrategy string = C.TIBDG_CONNECTION_PROPERTY_LONG_BINDSTRATEGY ConnectionPropertyLongConnectNumResponses string = C.TIBDG_CONNECTION_PROPERTY_LONG_CONNECT_NUMRESPONSES ConnectionPropertyLongConnectRetries string = C.TIBDG_CONNECTION_PROPERTY_LONG_REALM_CONNECT_RETRIES ConnectionPropertyStringClientLabel string = C.TIBDG_CONNECTION_PROPERTY_STRING_CLIENT_LABEL ConnectionPropertyStringConnectProxyNames string = C.TIBDG_CONNECTION_PROPERTY_STRING_CONNECT_PROXYNAMES ConnectionPropertyStringSecondaryRealm string = C.TIBDG_CONNECTION_PROPERTY_STRING_SECONDARY_REALM ConnectionPropertyStringTrustFile string = C.TIBDG_CONNECTION_PROPERTY_STRING_TRUST_FILE ConnectionPropertyStringTrustType string = C.TIBDG_CONNECTION_PROPERTY_STRING_TRUST_TYPE ConnectionPropertyStringUsername string = C.TIBDG_CONNECTION_PROPERTY_STRING_USERNAME ConnectionPropertyStringUserPassword string = C.TIBDG_CONNECTION_PROPERTY_STRING_USERPASSWORD )
Values for connection property ConnectionPropertyStringTrustType
const ( ConnectionHTTPSConnectionTrustEveryone string = C.TIBDG_CONNECTION_HTTPS_CONNECTION_TRUST_EVERYONE ConnectionHTTPSConnectionUseSpecifiedTrustFile string = C.TIBDG_CONNECTION_HTTPS_CONNECTION_USE_SPECIFIED_TRUST_FILE )
Values for connection property ConnectionPropertyLongBindStrategy
const ( ConnectionBindStrategyRandom int64 = C.TIBDG_CONNECTION_BINDSTRATEGY_RANDOM ConnectionBindStrategyNamed int64 = C.TIBDG_CONNECTION_BINDSTRATEGY_NAMED )
Iterator property names
const ( IteratorPropertyLongPrefetch string = C.TIBDG_ITERATOR_PROPERTY_LONG_PREFETCH IteratorPropertyStringConsistency string = C.TIBDG_ITERATOR_PROPERTY_STRING_CONSISTENCY IteratorPropertyDoubleFetchTimeout string = C.TIBDG_ITERATOR_PROPERTY_DOUBLE_FETCH_TIMEOUT )
Values for IteratorPropertyStringConsistency
const ( IteratorConsistencyGlobalSnapshot string = C.TIBDG_ITERATOR_CONSISTENCY_GLOBAL_SNAPSHOT IteratorConsistencySnapshot string = C.TIBDG_ITERATOR_CONSISTENCY_SNAPSHOT )
Session properties
const ( SessionPropertyBooleanTransacted string = C.TIBDG_SESSION_PROPERTY_BOOLEAN_TRANSACTED SessionPropertyStringCheckpointName string = C.TIBDG_SESSION_PROPERTY_STRING_CHECKPOINT_NAME )
Statement properties
const ( StatementPropertyLongPrefetch string = C.TIBDG_STATEMENT_PROPERTY_LONG_PREFETCH StatementPropertyStringConsistency string = C.TIBDG_STATEMENT_PROPERTY_STRING_CONSISTENCY StatementPropertyDoubleFetchTimeout string = C.TIBDG_STATEMENT_PROPERTY_DOUBLE_FETCH_TIMEOUT )
Values for StatementPropertyStringConsistency property
const ( StatementConsistencyGlobalSnapshot string = C.TIBDG_STATEMENT_CONSISTENCY_GLOBAL_SNAPSHOT StatementConsistencySnapshot string = C.TIBDG_STATEMENT_CONSISTENCY_SNAPSHOT )
Specify log level for the SetLogLevel function
const ( LogLevelOff string = C.TIB_LOG_LEVEL_OFF LogLevelSevere string = C.TIB_LOG_LEVEL_SEVERE LogLevelWarn string = C.TIB_LOG_LEVEL_WARN LogLevelInfo string = C.TIB_LOG_LEVEL_INFO LogLevelVerbose string = C.TIB_LOG_LEVEL_VERBOSE LogLevelDebug string = C.TIB_LOG_LEVEL_DEBUG )
const ( ASVersionMajorNum = 4 ASVersionMinorNum = 3 ASVersionUpdateNum = 0 ASVersionBuildNum = 2 ASVersionMajorString = "4" ASVersionMinorString = "3" ASVersionUpdateString = "0" ASVersionBuildString = "2" ASVersionReleaseTypeString = "" ASVersionStringCompare = "4.3.0 " ASVersionStringShort = "4.3.0 V2" ASVersionStringLong = "TIBCO Active Spaces Version " + ASVersionStringShort ASVersionCopyright = "\nCopyright Cloud Software Group, Inc.\nAll Rights Reserved. Confidential & Proprietary.\n" ASVersionBanner = ASVersionStringLong + ASVersionCopyright )
GridMetadata properties
const ( GridMetadataPropertyStringCheckpointName string = C.TIBDG_GRIDMETADATA_PROPERTY_STRING_CHECKPOINT_NAME )
Listener properties
const ( ListenerPropertyStringEventTypeList string = C.TIBDG_LISTENER_PROPERTY_STRING_EVENT_TYPE_LIST )
func ErrStack(e error) string
ErrStack returns a stack trace for an TIBDG error.
If the error passed in to this function was generated by the tibdg library, this will return a detailed description of the error, including the C stack trace associated with it, if available. If the error is not a tibdg error, this returns the results of calling e.Error().
func EventTypeListToString(eventTypeList []EventType) (string, error)
EventTypeListToString converts a list of EventTypes to a string
func SetLogChannel(out chan *LogEntry) error
SetLogChannel changes logging from stdout to the provided channel.
func SetLogFiles(filePrefix string, maxFileSize int64, maxFiles int32, p Props) error
SetLogFiles changes logging from stdout to append log messages to files based on the filePrefix.
func SetLogLevel(level string) error
SetLogLevel will generate log messages for this log level. By default, logging goes to stdout, but SetLogChannel and SetLogFiles can be used to change that.
BatchResult objects encapsulate the results of a single batch of operations.
They are returned by Session.GetRows(), Session.PutRows() and Session.DeleteRows().
type BatchResult struct {
// contains filtered or unexported fields
}
func (br *BatchResult) AllSucceeded() (success bool, err error)
AllSucceeded reports whether or not all the operations in the batch succeeded.
func (br *BatchResult) Destroy() error
Destroy explicitly destroys a BatchResult object and reclaims its resources.
func (br *BatchResult) GetRow(rowNum int) (row *Row, err error)
GetRow returns a specific row from the BatchResult.
This is only valid for GET batches. You must call AllSucceeded prior to this to ensure the batch succeeded.
func (br *BatchResult) GetSize() (sz int, err error)
GetSize returns the number of rows in the BatchResult.
ColumnMetadata objects contain information about a specific column
type ColumnMetadata struct { Name string // the name of the column Type ColumnType // the type of the column TableMetadata *TableMetadata // a pointer to the table metadata for the table the column belongs to }
ColumnType represents the type of a column in a table
type ColumnType int
These are all the possible values for ColumnType.
const ( ColumnTypeInvalid ColumnType = C.TIBDG_COLUMN_TYPE_INVALID ColumnTypeLong ColumnType = C.TIBDG_COLUMN_TYPE_LONG ColumnTypeString ColumnType = C.TIBDG_COLUMN_TYPE_STRING ColumnTypeOpaque ColumnType = C.TIBDG_COLUMN_TYPE_OPAQUE ColumnTypeDatetime ColumnType = C.TIBDG_COLUMN_TYPE_DATETIME ColumnTypeDouble ColumnType = C.TIBDG_COLUMN_TYPE_DOUBLE ColumnTypeUnknown ColumnType = C.TIBDG_COLUMN_TYPE_UNKNOWN )
func ColumnTypeFromString(columnTypeString string) (columnType ColumnType, err error)
ColumnTypeFromString parses the string and returns the corresponding ColumnType.
func (columnType ColumnType) String() (ret string)
String returns the column type as a string
Connection objects provide access to a data grid.
The Connection object creates or opens all resources associated with a given data grid. A program that creates a connection can explicitly call Connection.Close() to reclaim its resources.
type Connection struct { RealmURL string // the URL of the realm Properties Props // a copy of the properties supplied when creating the Connection // contains filtered or unexported fields }
func NewConnection(url string, gridName string, props Props) (conn *Connection, err error)
NewConnection creates a new Connection to the data grid.
func (conn *Connection) Close() error
Close closes the Connection to the data grid and frees the underlying resources.
func (conn *Connection) GetGridMetadata(props Props) (gmd *GridMetadata, err error)
GetGridMetadata returns a GridMetadata object that can be used to get information about the data grid.
Note that the GridMetadata object returned contains a snapshot of the data grid at that the time the object is being created. If tables are subsequently created, modified or destroyed, those changes will not be reflected in any GridMetadata that was created previously.
To access the metadata for the data grid at a specific checkpoint, pass in a Props object with the the property GridMetadataPropertyStringCheckpointName set to the name of the checkpoint.
func (conn *Connection) NewSession(props Props) (sess *Session, err error)
NewSession creates a new Session object for performing operations on the data grid.
DeleteEvent objects are Events that indicate that a row was Deleted from the table.
type DeleteEvent struct { Previous *Row // the value of the Row prior to deletion // contains filtered or unexported fields }
func (deleteEvent *DeleteEvent) Destroy()
Destroy destroys the Event, reclaiming all its resources.
func (deleteEvent DeleteEvent) EventType() EventType
EventType returns the type of the Event.
func (deleteEvent *DeleteEvent) Listener() *Listener
Listener returns a pointer to the Listener that generated the PutEvent.
func (deleteEvent *DeleteEvent) String() string
String returns a string representation of the Event
ErrorCode is a numeric error code that will always be one of the error constants defined below
type ErrorCode int
Error constants returned by ErrCode()
const ( ErrUnknown ErrorCode = -2 ErrNullException ErrorCode = C.TIB_NULL_EXCEPTION ErrOk ErrorCode = C.TIB_OK ErrInvalidArg ErrorCode = C.TIB_INVALID_ARG ErrNoMemory ErrorCode = C.TIB_NO_MEMORY ErrTimeout ErrorCode = C.TIB_TIMEOUT ErrNotInitialized ErrorCode = C.TIB_NOT_INITIALIZED ErrOsError ErrorCode = C.TIB_OS_ERROR ErrIntr ErrorCode = C.TIB_INTR ErrNotPermitted ErrorCode = C.TIB_NOT_PERMITTED ErrNotFound ErrorCode = C.TIB_NOT_FOUND ErrIllegalState ErrorCode = C.TIB_ILLEGAL_STATE ErrNotSupported ErrorCode = C.TIB_NOT_SUPPORTED ErrEndOfBuffer ErrorCode = C.TIB_END_OF_BUFFER ErrVersionMismatch ErrorCode = C.TIB_VERSION_MISMATCH ErrAlreadyExists ErrorCode = C.TIB_ALREADY_EXISTS ErrFileIoError ErrorCode = C.TIB_FILE_IO_ERROR ErrInvalidValue ErrorCode = C.TIB_INVALID_VALUE ErrInvalidType ErrorCode = C.TIB_INVALID_TYPE ErrInvalidConfig ErrorCode = C.TIB_INVALID_CONFIG ErrInvalidFormat ErrorCode = C.TIB_INVALID_FORMAT ErrClientShutdown ErrorCode = C.TIB_CLIENT_SHUTDOWN ErrorCode = C.TIB_RESOURCE_UNAVAILABLE ErrLimitReached ErrorCode = C.TIB_LIMIT_REACHED ErrorCode = C.TIB_FORMAT_UNAVAILABLE ErrException ErrorCode = C.TIB_EXCEPTION ErrUnknownSysprop ErrorCode = C.TIB_UNKNOWN_SYSPROP ErrRsUnknownError ErrorCode = C.TIB_RS_UNKNOWN_ERROR ErrRsInvalidSessionUser ErrorCode = C.TIB_RS_INVALID_SESSION_USER ErrRsUnknownOperationCode ErrorCode = C.TIB_RS_UNKNOWN_OPERATION_CODE ErrRsInternalServerError ErrorCode = C.TIB_RS_INTERNAL_SERVER_ERROR ErrRsProtocolMismatch ErrorCode = C.TIB_RS_PROTOCOL_MISMATCH ErrRsMissingProtocol ErrorCode = C.TIB_RS_MISSING_PROTOCOL ErrRsMissingClientID ErrorCode = C.TIB_RS_MISSING_CLIENT_ID ErrRsKeyNotFound ErrorCode = C.TIB_RS_KEY_NOT_FOUND ErrRsServerIsntPaused ErrorCode = C.TIB_RS_SERVER_ISNT_PAUSED ErrRsServerIsReadonly ErrorCode = C.TIB_RS_SERVER_IS_READONLY ErrRsServerIsShuttingDown ErrorCode = C.TIB_RS_SERVER_IS_SHUTTING_DOWN ErrRsServerIsStartingUp ErrorCode = C.TIB_RS_SERVER_IS_STARTING_UP ErrRsDbGenerationMismatch ErrorCode = C.TIB_RS_DB_GENERATION_MISMATCH ErrRsInvalidState ErrorCode = C.TIB_RS_INVALID_STATE ErrRsInvalidMode ErrorCode = C.TIB_RS_INVALID_MODE ErrRsAdminOperationFailed ErrorCode = C.TIB_RS_ADMIN_OPERATION_FAILED ErrRsUpdateInProgress ErrorCode = C.TIB_RS_UPDATE_IN_PROGRESS ErrRsIncompatibleClient ErrorCode = C.TIB_RS_INCOMPATIBLE_CLIENT ErrInvalidResource ErrorCode = C.TIBDG_INVALID_RESOURCE ErrGridInMaintenance ErrorCode = C.TIBDG_GRID_IN_MAINTENANCE ErrSQLSyntaxError ErrorCode = C.TIBDG_SQL_SYNTAX_ERROR ErrSQLNotSupported ErrorCode = C.TIBDG_SQL_NOT_SUPPORTED ErrSQLInvalidValue ErrorCode = C.TIBDG_SQL_INVALID_VALUE ErrSQLParserError ErrorCode = C.TIBDG_SQL_PARSER_ERROR ErrSQLStmtError ErrorCode = C.TIBDG_SQL_STMT_ERROR ErrSQLSystemError ErrorCode = C.TIBDG_SQL_SYSTEM_ERROR ErrSQLQueryError ErrorCode = C.TIBDG_SQL_QUERY_ERROR ErrSQLDdlCmdError ErrorCode = C.TIBDG_SQL_DDL_CMD_ERROR ErrSQLQueryCmdError ErrorCode = C.TIBDG_SQL_QUERY_CMD_ERROR ErrSQLDmlCmdError ErrorCode = C.TIBDG_SQL_DML_CMD_ERROR ErrSQLCmdError ErrorCode = C.TIBDG_SQL_CMD_ERROR ErrSQLNotPermitted ErrorCode = C.TIBDG_SQL_NOT_PERMITTED )
func ErrCode(e error) ErrorCode
ErrCode returns the numeric error code from a tibdg error.
If the error passed to this function was generated by tibdg, this will return the ErrorCode associated with it. If an error is passed in that did NOT originate from the tibdg library, ErrUnknown is returned.
ErrorEvent objects are Events that indicate the Listener encountered an error.
type ErrorEvent struct { ErrorCode EventErrorCode // the type of error ErrorDescription string // a description of the error // contains filtered or unexported fields }
func (errorEvent *ErrorEvent) Destroy()
Destroy destroys the Event, reclaiming all its resources.
func (errorEvent ErrorEvent) EventType() EventType
EventType returns the type of the Event.
func (errorEvent *ErrorEvent) Listener() *Listener
Listener returns a pointer to the Listener that generated the ErrorEvent.
func (errorEvent *ErrorEvent) String() string
String returns a string representation of the Event
Event is an interface that is implemented by all types of Event.
type Event interface { EventType() EventType // EventType returns the type of the Event Destroy() // Destroy destroys the underlying event Listener() *Listener // Listener provides a pointer to the Listener that generated the Event String() string // Return a string representation of the Event }
EventErrorCode is the type of error that the ErrorEvent is reporting.
type EventErrorCode int
These are all the possible values for EventErrorCode.
const ( EventErrorCodeInvalid EventErrorCode = C.TIBDG_EVENT_ERROR_CODE_INVALID EventErrorCodeTableDeleted EventErrorCode = C.TIBDG_EVENT_ERROR_CODE_TABLE_DELETED EventErrorCodeCopysetLeaderFailure EventErrorCode = C.TIBDG_EVENT_ERROR_CODE_COPYSET_LEADER_FAILURE EventErrorCodeGridRedistributing EventErrorCode = C.TIBDG_EVENT_ERROR_CODE_GRID_REDISTRIBUTING EventErrorCodeProxyFailure EventErrorCode = C.TIBDG_EVENT_ERROR_CODE_PROXY_FAILURE )
func (eventErrorCode EventErrorCode) String() (ret string)
String returns a string representation of the EventErrorCode.
EventType is used to indicate the type of the Event.
type EventType int
These are all the possible values for EventType.
const ( EventTypeInvalid EventType = C.TIBDG_EVENT_TYPE_INVALID EventTypePut EventType = C.TIBDG_EVENT_TYPE_PUT EventTypeDelete EventType = C.TIBDG_EVENT_TYPE_DELETE EventTypeError EventType = C.TIBDG_EVENT_TYPE_ERROR EventTypeExpired EventType = C.TIBDG_EVENT_TYPE_EXPIRED )
func (eventType EventType) String() (ret string)
String returns a string representation of the Event.
ExpiredEvent objects are that indicate that a row in the table was removed because it expired.
type ExpiredEvent struct { Previous *Row // the value of the Row prior to expiration // contains filtered or unexported fields }
func (expiredEvent *ExpiredEvent) Destroy()
Destroy destroys the event, reclaiming all its resources.
func (expiredEvent ExpiredEvent) EventType() EventType
EventType returns the type of the Event.
func (expiredEvent *ExpiredEvent) Listener() *Listener
Listener returns a pointer to the Listener that generated the ExpiredEvent.
func (expiredEvent *ExpiredEvent) String() string
String returns a string representation of the Event
GridMetadata objects contain metadata information about the data grid and the tables in the data grid.
type GridMetadata struct { Name string // the name of the grid Version string // the version of the software the grid is using Tables map[string]TableMetadata // a map of the table metadata for the tables in the grid, keyed by table name Connection *Connection // the connection that created the grid metadata }
IndexMetadata objects contain information about a specific index
type IndexMetadata struct { Name string // the name of the index Columns []ColumnMetadata // the columns that comprise the index TableMetadata *TableMetadata // a pointer to the table metadata for the table the column belongs to }
Iterator objects traverse the rows of a Table, or a subset of them if a filter was used when creating the Iterator.
type Iterator struct { Table *Table // the Table that will be iterated over // contains filtered or unexported fields }
func (iter *Iterator) Close() error
Close explicitly releases the resources associated with the Iterator.
func (iter *Iterator) HasNext() (hasNext bool, err error)
HasNext informs the caller if the Iterator has more rows or not.
func (iter *Iterator) Next() (nextRow *Row, err error)
Next advances the iterator to the next row and returns it.
This call advances the iterator beyond the current row. If the next row exists, this call returns it. If the current row is the last or if an exception has been thrown, this call returns NULL.
This call may block in order to fetch the next batch of rows.
A Listener is created on a Table and sends Events to its Channel when changes take place in the underlying table.
type Listener struct { Filter string // the Filter parameter used when the Listener was created Table *Table // the Table on which to listen Channel chan Event // the channel on which the Events will be sent // contains filtered or unexported fields }
func (listener *Listener) Destroy() error
Destroy explicitly destroys a Listener object and reclaims its resources.
LogEntry values can be received when using SetLogChannel
type LogEntry struct { Timestamp time.Time Statement string }
Props type is used for tibdg functions that take a properties argument.
Various properties are defined as constants throughout the interface.
type Props map[string]interface{}
PutEvent objects are Events that indicate that a row was Put into the table.
type PutEvent struct { Previous *Row // the value of the Row prior to the Put Current *Row // the value of the Row that was Put into the table // contains filtered or unexported fields }
func (putEvent *PutEvent) Destroy()
Destroy destroys the Event, reclaiming all its resources.
func (putEvent PutEvent) EventType() EventType
EventType returns the type of the Event.
func (putEvent *PutEvent) Listener() *Listener
Listener returns a pointer to the Listener that generated the PutEvent.
func (putEvent *PutEvent) String() string
String returns a string representation of the Event
ResultColumnMetadata objects provide information about columns in a Statement's results.
type ResultColumnMetadata struct { Name string // the name of the column in the underlying table (if this column exists in the table) Label string // the name of the column in the resultset Type ColumnType // the type of the column TableName string // the name of the table the column comes from Nullable bool // indicates whether or not this column can contain null values }
ResultSet objects are created when a Statement is executed.
They contain the results of executing the Statement in the form of Rows.
type ResultSet struct { Statement *Statement // the Statement that generated the ResultSet // contains filtered or unexported fields }
func (rs *ResultSet) Close() error
Close explicitly closes a ResultSet object and reclaims its resources.
func (rs *ResultSet) HasNext() (hasNext bool, err error)
HasNext informs the caller if the ResultSet has more Rows or not.
func (rs *ResultSet) Next() (nextRow *Row, err error)
Next advances the ResultSet to the next Row and returns it.
This call advances the ResultSet beyond the current Row. If the next Row exists, this call returns it. If the current Row is the last or if an exception has been thrown, this call returns NULL. Note that the data in the Row that is returned can be accessed but the Row cannot be used for table operations such as Put, Get, etc.
This call may block in order to fetch the next batch of rows.
ResultSetMetadata objects describe the columns in the Statement's ResultSet.
type ResultSetMetadata struct { Columns []ResultColumnMetadata // the columns in the ResultSet Statement *Statement // the Statement that generated the ResultSet }
Row represents a row of data from a table.
type Row struct { Table *Table // the Table containing the Row, may be nil if the Row belongs to a ResultSet. // contains filtered or unexported fields }
func (r Row) Clear() error
Clear the content of a row to preserve space.
func (r *Row) Copy() (copy *Row, err error)
Copy returns a copy of the Row and all its data.
func (r *Row) Destroy() error
Destroy explicitly destroys a Row object and reclaims its resources.
func (r *Row) Get(columns ...string) (c RowContent, err error)
Get all or at most specific values stored in the row Only columns present in the row will end up in the returned RowContent This is true even if the field was explicitly listed for retrieval.
func (r *Row) GetColumnType(name string) (ColumnType, error)
GetColumnType returns the type of the named column.
func (r *Row) GetExpiration() (time.Time, error)
GetExpiration returns the expiration time for the row.
It is an error to call this on a Row if the Row's table does not have expiration enabled or if the Row was not retrieved from a Table or Iterator.
func (r *Row) IsColumnSet(name string) (b bool, err error)
IsColumnSet indicates whether or not the named column is set in the Row.
func (r *Row) Set(c RowContent) (ex error)
Set all specified key/value pairs to corresponding fields. The type is determined by the value type. See RowContent for conversion. This function will panic if an unknown type is used. When called multiple times the row will only contain the content of the last Set calling Set(nil) is identical to Clear()
func (r *Row) SetTTL(ttl int64) error
SetTTL sets the time-to-live for this Row, overriding the table's default value.
An application can set this on a Row before storing it in the table to override the table's default TTL value.
It is an error to set this on a Row if the Row's table does not have expiration enabled.
func (r *Row) String() string
String returns a string representation of the Row.
func (r *Row) Update(c RowContent) (ex error)
Update updates the Row with only the columns in the RowContent parameter. All other rows are left unchanged. The type is determined by the value type. See RowContent for conversion. This function will panic if an unknown type is used. If an error occurs during the operation of this function, the state of the Row afterwards will be undefined.
RowContent is used to set values in the Set function and receive them through the Get function. supported types for the value are: Integer types become int64 values in the tibdg.Row
int, int64, int32, int16, int8 uint, uint64, uint32, uint16, uint8, uintptr
byte slices become opaque values in the tibdg.Row
[]byte, []uint8
The following types have corresponding slice versions as well.
Float types become float64 values in the tibdg.Row
float64, float32.
String types become string values in the tibdg.Row:
string, *string
Time types become time.Time in the tibdg.Row:
time.Time
The types converted to are the types received.
type RowContent map[string]interface{}
Session objects provide the context for a thread of operations involving data grid resources.
type Session struct { Conn *Connection // the Connection that created the Session // contains filtered or unexported fields }
func (session *Session) Commit() error
Commit commits the current transaction on this Session and begins a new transaction.
Committing a transaction causes the data grid to make permanent all table operations performed since the start of the current transaction.
func (session *Session) DeleteRows(rows []*Row, props Props) (br *BatchResult, err error)
DeleteRows Deletes a number of Rows from the data grid matching the key Rows in the slice provided by the caller.
The BatchResult returned can be used to find out if all the Delete operations succeeded or not.
Note: the rows may be on different tables. Not valid for transacted sessions
func (session *Session) Destroy() error
Destroy explicitly destroys a Session object and reclaims its resources.
func (session *Session) ExecuteUpdate(sqlString string, props Props) (int64, error)
ExecuteUpdate executes a SQL Update.
A SQL update can be Create Table, Create Index, Drop Table, or Drop Index.
func (session *Session) GetRows(rows []*Row, props Props) (br *BatchResult, err error)
GetRows Gets a number of Rows from the data grid matching the key Rows in the slice provided by the caller.
The BatchResult returned can be used to find out if all the Get operations succeeded or not. If they did then the Rows that matched the input Rows can be accesses from the BatchResult.
Note: the rows may be on different tables. Not valid for transacted sessions
func (session *Session) NewStatement(sqlString string, props Props) (stmt *Statement, err error)
NewStatement function as declared in tibdg/sess.h:134
The Statement's ExecuteQuery call will block while it fetches the first batch of Rows. If fetching each batch of Rows is always expected to take a long time then the StatementPropertyDoubleFetchTimeout property should be set when the Statement is created to prevent the fetch requests from timing out. The value provided when the Statement is created can also be overridden each time the Statement is executed. If a value of zero is supplied for this property then there will be no limit to how long the application will wait.
func (session *Session) OpenTable(name string, props Props) (tab *Table, err error)
OpenTable opens a Table in the data grid.
func (session *Session) PutRows(rows []*Row, props Props) (br *BatchResult, err error)
PutRows Puts a slice of Rows into the data grid.
The BatchResult returned can be used to find out if all the Put operations succeeded or not.
Note: the rows may be on different tables. Not valid for transacted sessions
func (session *Session) Rollback() error
Rollback rolls back a transaction on this Session.
Rolling back a transaction causes the data grid to discard all table operations performed since the start of the transaction.
Statement objects are used to execute SQL and return ResultSets.
type Statement struct { ParameterCount int64 // the number of parameters in the statement Metadata *ResultSetMetadata // describes the columns in the ResultSet. Session *Session // a pointer to the Session that was used to create the Statement // contains filtered or unexported fields }
func (stmt *Statement) ClearParameters() error
ClearParameters clears all the parameters in a parameterized Statement.
func (stmt *Statement) Close() error
Close closes the Statement and reclaims its resources.
func (stmt *Statement) ExecuteQuery(props Props) (rs *ResultSet, err error)
ExecuteQuery executes the Statement and returns a ResultSet.
This call will block while it fetches the first batch of Rows. If fetching each batch of Rows is expected to take a long time then the StatementPropertyDoubleFetchTimeout property should be set to prevent the fetch requests from timing out. If this property is set when the Statement is created, it will apply be applied to all executions of the Statement. If you wish to override that value for a particular execution, it can be set when calling this ExecuteQuery function. If a value of zero is supplied for this property then there will be no limit to how long the application will wait.
func (stmt *Statement) ExecuteUpdate(props Props) (count int64, err error)
ExecuteUpdate executes an update statement and returns the number of rows that were updated.
func (stmt *Statement) SetFloat(parameterIndex int, float float64) error
SetFloat sets the value of the particular parameter in the Statement to a given value.
func (stmt *Statement) SetLong(parameterIndex int, long int64) error
SetLong sets the value of the particular parameter in the Statement to a given value.
func (stmt *Statement) SetNull(parameterIndex int) error
SetNull sets the value of the particular parameter in the Statement to NULL.
func (stmt *Statement) SetOpaque(parameterIndex int, opaque []byte) error
SetOpaque sets the value of the particular parameter in the Statement to a given value.
func (stmt *Statement) SetString(parameterIndex int, str string) error
SetString sets the value of the particular parameter in the Statement to a given value.
func (stmt *Statement) SetTime(parameterIndex int, time time.Time) error
SetTime sets the value of the particular parameter in the Statement to a given value.
Table objects represent tables of rows.
The individual rows of a Table can be modified by Put or Delete operations or retrieved by Get operations. Iterators and Statements retrieve multiple rows from the table and Listeners allow a program to receive notifications when the table is modified.
type Table struct { Name string // the name of the Table Session *Session // the Session used to create the Table object // contains filtered or unexported fields }
func (table *Table) Close() error
Close explicitly destroys a Table object and reclaims its resources.
func (table *Table) Delete(key *Row) error
Delete removes a Row from the table if there is one that matches the key.
If there is no Row that matches the key, no error will be reported.
func (table *Table) Get(key *Row) (r *Row, err error)
Get retrieves a Row from the table if there is one that matches the key, otherwise nil is returned.
func (table *Table) NewIterator(filter string, props Props) (iter *Iterator, err error)
NewIterator function as declared in tibdg/table.h:118
If filter is nil, all the rows will be returned. To iterate over a subset of Rows, provide a filter string using the syntax of an SQL WHERE clause, e.g. "key < 100".
func (table *Table) NewListener(filter string, props Props, channel chan Event) (lsnr *Listener, err error)
NewListener creates a Listener that will send Events relating to the Table to the provided Channel.
If filter is the empty string, the Listener will receive all Events on the Table. Provide a non-empty string (using the syntax of a SQL WHERE clause) if you only want to receive Events for rows that match a given filter.
func (table *Table) NewRow() (r *Row, err error)
NewRow creates a new Row object for a given Table.
func (table *Table) Put(keyValue *Row) error
Put stores the Row in the Table.
TableMetadata objects contain information about a specific table in the data grid. This information includes column names, column types, index names, etc.
type TableMetadata struct { Name string // the name of the table DefaultTTL int64 // the default Time To Live for rows in the table, zero means they will never expire Columns []ColumnMetadata // the columns that comprise the table Indexes []IndexMetadata // the indexes on the table PrimaryIndex *IndexMetadata // a pointer to the primary index GridMetadata *GridMetadata // a pointer to the grid metadata for the grid the table belongs to }