TVersionedSqlDatabase

Decorates a TSqlDatabase to add versioning functionality

Inheritance

LevelAncestorDescription
1TObjectUltimate ancestor in a class hierarchy
2TSqlStatementExecutorAbstract base class for a facility that executes a TSqlStatement
3TSqlDatabase Abstract base class for connections to databases that can be queried using SQL statements.
4TLogicalSqlDatabase Abstract base class for TSqlDatabase implementations that manipulate or translate queries before they sent to an actual physical TSqlDatabase.
5TAnnotatingSqlDatabaseA base class for databases that provide tables of an annotation.
6TVersionedSqlDatabase

Source

Sql.Database.Logical.Versioned.pas (72)

Description

In order to version a TSqlTable, the Lifetime member of that class should be instantiated. The table can then be queried as normal, which defaults to querying current data. To query previous versions, or the entire history of a table, various temporal modifiers are available on TSqlTable.

Versioning is achieved through adding two columns to a TSqlTable: AddTransactionID and RemoveTransactionID, which give the lifetime of a table row. Rows without a RemoveTransactionID are considered current data.

Data removed or modified in the same transaction as it was added is not stored, meaning no rows will have the same AddTransactionID and RemoveTransactionID.

Fields

ScopeVisibilityTypeNameDescription
InstanceprotectedTSqlVersioningTransactionVersioningTransaction
InstanceprotectedTSqlTransactionTransaction

Methods

ScopeVisibilityResultNameDescription
InstanceprotectedStartUpdateOperation(Table: TSqlTable)
InstanceprotectedEndUpdateOperation()
InstanceprotectedAddDeleteRestrictions(Delete: TSqlDelete; Table: TSqlTable)
InstanceprotectedAddDeleteAssignments(Update: TSqlUpdate; Table: TSqlTable)
InstanceprotectedAddManagingRestrictions(Expression: TSqlExpression)
InstanceprotectedUpdateManagingColumns(UpdateOperation: TLogicalSqlUpdateOperation)
InstanceprotectedTBooleanIsManaged(Table: TSqlTable)
InstanceprotectedTBooleanIsManaged(Table: TSqlTable; Column: TSqlTableColumn)
InstanceprotectedTLogicalSqlUpdateOperationCreateUpdateOperation(Table: TSqlTable; Columns: TList<TSqlTableColumn>)
InstanceprotectedHandleAlterTable(AlterTable: TSqlAlterTable)
InstanceprotectedHandleCreateTable(CreateTable: TSqlCreateTable)
InstancepublicTSqlResultQuery(Statement: TSqlStatement; ResultMethod: TSqlQueryResultMethod)
InstancepublicTSqlTransactionStartTransaction()
InstancepublicEndTransaction(Transaction: TSqlTransaction)