TVersionedSqlDatabase
TSqlDatabase
to add versioning functionalityInheritance
Level | Ancestor | Description |
---|---|---|
1 | TObject | Ultimate ancestor in a class hierarchy |
2 | TSqlStatementExecutor | Abstract base class for a facility that executes a TSqlStatement |
3 | TSqlDatabase | Abstract base class for connections to databases that can be queried using SQL statements. |
4 | TLogicalSqlDatabase |
Abstract base class for TSqlDatabase implementations that manipulate or translate queries before they sent to an
actual physical TSqlDatabase .
|
5 | TAnnotatingSqlDatabase | A base class for databases that provide tables of an annotation. |
6 | TVersionedSqlDatabase |
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
Scope | Visibility | Type | Name | Description |
---|---|---|---|---|
Instance | protected | TSqlVersioningTransaction | VersioningTransaction | |
Instance | protected | TSqlTransaction | Transaction |
Methods
Scope | Visibility | Result | Name | Description |
---|---|---|---|---|
Instance | protected | StartUpdateOperation(Table: TSqlTable) | ||
Instance | protected | EndUpdateOperation() | ||
Instance | protected | AddDeleteRestrictions(Delete: TSqlDelete; Table: TSqlTable) | ||
Instance | protected | AddDeleteAssignments(Update: TSqlUpdate; Table: TSqlTable) | ||
Instance | protected | AddManagingRestrictions(Expression: TSqlExpression) | ||
Instance | protected | UpdateManagingColumns(UpdateOperation: TLogicalSqlUpdateOperation) | ||
Instance | protected | TBoolean | IsManaged(Table: TSqlTable) | |
Instance | protected | TBoolean | IsManaged(Table: TSqlTable; Column: TSqlTableColumn) | |
Instance | protected | TLogicalSqlUpdateOperation | CreateUpdateOperation(Table: TSqlTable; Columns: TList<TSqlTableColumn>) | |
Instance | protected | HandleAlterTable(AlterTable: TSqlAlterTable) | ||
Instance | protected | HandleCreateTable(CreateTable: TSqlCreateTable) | ||
Instance | public | TSqlResult | Query(Statement: TSqlStatement; ResultMethod: TSqlQueryResultMethod) | |
Instance | public | TSqlTransaction | StartTransaction() | |
Instance | public | EndTransaction(Transaction: TSqlTransaction) |