Home About Products Downloads Ordering Forum My Account

Database Extensions

Overview

Package

Screen shots
Downloads
Ordering
Request Info
Version History

Subscribe to our news


CONTEXT DATABASE EXTENSIONS

Package Description

Database Extensions add some great features to the Database engines:

  • Build-in database schema diagramming tool (accessible from Delphi IDE)
  • Database version control, including incremental updates (SQL Script).
  • Database manipulations (export/import to disk file)
  • Macroses in SQL
  • Referential integrity constraints
  • Triggers (SQL Script)
  • Replications
  • Centralized Events & Errors handling
  • Automatic Pascal declarations for tables defined in the database schema and much more.

The package also includes component & diagram editor help files and demos, explaining most of its functionality.

The component suite consists of some generic components, implementing database schema and defining business logic (TDatabaseSchema, TDBDocumentType, TDBDocument, TDBJournal), as well as some DBISAM & NexusDB specific components.

Following is the list of features and properties by components:

 TDatabaseSchema

This component is a persistent storage for the database schema definitions, including table definitions, indexes, RI constraints, triggers and incremental database version updates. Diagram drawing tool is provided as a default component editor for the TDatabaseSchema, putting the power of entity-relation diagramming right at your fingertips (see screenshots).

You can easily save and restore schema to/from a file on disk and, using it in combination with TxxDatabaseExt (see below) you can create new database from schema (and even load default data in it), restructure existing database to match given schema, reverse engineer the database to get its schema, incrementally update database's version to a current version, using updates (version history) saved in schema. This greatly simplifies the way you distribute updates to your application, since now you won't have to think about upgrading possible different versions of the database to the latest schema - the application will do it automatically by keeping track of all past versions and applying incremental update scripts.

 TDBEnumeration &  TDBSchemaEnum

Database Extensions Package introduces enumerations, which are very much like enumerations defined in Pascal. Enumerations are very helpful, when you need to specify a set of limited choices (Order Statuses and States, User Types, etc.) Enumerations defined in schema may be exposed, using TDBEnumeration component, derived from TDataSet, allowing to produce simple lookup fields, that will display the full name or description of a value. This is a simple way to save on coding and avoid calculated fields. See Enumerations demo included in the package.

 TDBSequences

TDBSequences component implements generic sequences, that could be used as unque key generators (similar to Oracle's sequences). TDBSequence component is database independant and uses external SequenceTable (which could be any TDataSet descendant) to access a table, where each sequence must have a corresponding field. Sequence table is assumed to always have only one record. If it is empty, a new record (with null values) will be added when you first try to access any sequence. See Sequences demo included in the package.

 TDBRecord

TDBRecord is a simple TDataSet descendant, that represents a dataset (defined at design-time, by creating persistent fields) containing only one record of data. This component is usefull when implementing forms, using only data-aware controls. It may contain additional fields, that are not part of any actual database dataset. TDBRecord may contain any field types except Blobs. See DBRecord demo included in the package.

DBISAM Specific Components

 TDBISAMDatabaseExt

This component is a replacement for the standard TDBISAMDatabase component. It is extended to implement functionality required to support schema operations such as maintaining referential integrity, tracking changes to the database objects (so it can be replicated later), auto-calculating fields and more. TDBISAMDatabaseExt also provides several convenient events and properties:

AutoRefreshOnRollback property if set to True (default False) will cause all tables to be automatically refreshed is the current transaction is rolled back.
DatabaseURL property allows to represent database connection string in a uniform way no matter whether it is local or remote connection.
UpdateOptinos property controls which extended features (such as triggers, change tracking, constraints, etc.) are enabled for this database.
Schema property points to the TDatabaseSchema component, containing the schema for this database.
ReplicationsConflictOptions property controls the way replication conflicts are handled.
SystemTableName & ObjectsTableName properties define names of the system tables, storing information about changes and other extended settings.

DataSetBeforeOpen & DataSetBeforeClose events allow to centrally perform additional tasks whenever a table of query is opened or closed on this database.
OnProgress event is triggered to report progress on massive database operations, such as replication, export and import.
OnReplicationConflict event allows to handle replication conflicts in a user defined way.

Note, that current version of Database Extensions only provide client-side support for referential integrity and change tracking. Therefore these operations might lightly slow down updates when working in C/S mode. This also means, that changes performed using SQL insert, update and delete statements will not be tracked, the corresponding triggers will not be invoked and RI constraints will not enforced.

 TDBISAMTableExt &  TDBISAMQueryExt

These components are provided as replacements for the standard TDBISAMTable & TDBISAMQuery components. They work together with TDBISAMDatabaseExt to support changes tracking, triggers & RI constraints. These components have several extra properties, that extend their functionality:

AllowAutoOpen property if set to True (default False) forces a dataset (table or query) to Active state automatically when it is first accessed. This allows to expedite application loading by minimizing the number of tables, that have to be opened at startup.
AutoFieldsProperties property is similar to the standard AutoDisplayLabels, only it takes information about fields (Description, Format, DefaultExpression, Attributes, etc.) from the database schema.
OptimizedLookups property (default False) if set to True changes the way the lookups are handled, by avoiding multiple searches by the same set of keys. This may greatly improve lookup speed if your database defines multiple lookups, based on the same set of keys (for instance, Order table may define customer's lookups, such as LastName, FirstName, etc. based on the same CustomerID. In the standard VCL approach this will lead to LocateRecord being called for every field, while OptimizedLookups ensure, that it's only called one.)
Temporary property in combination with Memory database name will force a table to be created and dropped every time, when it's opened and closed. This makes DBISAM memory tables behave similar to simple memory tables, like DevEx's TDxMemData and such.
UpdateOptions property controls which extended features (such as triggers, change tracking, constraints, etc.) are enabled for this dataset.

In addition to these options TDBISAMQueryExt also has several properties to support Macros within SQL statements:

AllowMacros property defines, whether the SQL statement will be preprocessed for macros.
MacroBegin & MacroEnd property defines the characters that surround macro. Default values are '<%' and '%>'.
     Example: select * from <%table_name%> order by <%order_clause%>
Macros collection (filled in automatically by parsing SQL) declares the macros and allows to set up their values. You can also use MacroByName method of TDBISAMQueryExt component.

 TDBISAMEvents

TDBISAMEvents components (descendant of TAppEvents) intercepts DBISAM-specific as well as other application-level events. If you use one or more components per application they will form a chain.

The following key properties are defined:

Messages property allows to overwrite default messages for different error codes. The format is:
    ERROR_CODE=MESSAGE
    ERROR_CODE=. -- Ignore this error and don't show any message.
    Example: 10258=The record in %table% is locked by another user
DBISAM Errors usually contains additional information, like table name, user name, database name, etc. All these parameters are accessible through the use of %parameter% format (see above).
AskRetryMessage & AskRetryOnLockError properties controls application's behavior in case the record is locked by another user. If AskRetryOnLockError is set to True AskRetryMessage will be shown to confirm retry.
IgnoreRecordChangedError property controls application's behaviors if the record is changed by another user (infamous 8708 error).
AutoHookUpToDBISAMDataSets property tells TDBISAMEvents to automatically hook up to all the datasets on the current form or data module.

NexusDB Specific Components

 TnxDatabaseExt

This component is a replacement for the standard TnxDatabase component. It is extended to implement functionality required to support schema operations such as maintaining referential integrity, tracking changes to the database objects (so it can be replicated later), auto-calculating fields and more. TnxDatabaseExt also provides several convenient events and properties:

AutoRefreshOnRollback property if set to True (default False) will cause all tables to be automatically refreshed is the current transaction is rolled back.
DatabaseURL property allows to represent database connection string in a uniform way no matter whether it is local or remote connection.
UpdateOptinos property controls which extended features (such as triggers, change tracking, constraints, etc.) are enabled for this database.
Schema property points to the TDatabaseSchema component, containing the schema for this database.
ReplicationsConflictOptions property controls the way replication conflicts are handled.
SystemTableName & ObjectsTableName properties define names of the system tables, storing information about changes and other extended settings.

DataSetBeforeOpen & DataSetBeforeClose events allow to centrally perform additional tasks whenever a table of query is opened or closed on this database.
OnProgress event is triggered to report progress on massive database operations, such as replication, export and import.
OnReplicationConflict event allows to handle replication conflicts in a user defined way.

Note, that current version of Database Extensions only provide client-side support for referential integrity and change tracking. Therefore these operations might lightly slow down updates when working in C/S mode. This also means, that changes performed using SQL insert, update and delete statements will not be tracked, the corresponding triggers will not be invoked and RI constraints will not enforced.

 

 TnxTableExt &  TnxQueryExt

 

These components are provided as replacements for the standard TnxTable & TnxQuery components. They work together with TnxDatabaseExt to support changes tracking, triggers & RI constraints. These components have several extra properties, that extend their functionality:

AllowAutoOpen property if set to True (default False) forces a dataset (table or query) to Active state automatically when it is first accessed. This allows to expedite application loading by minimizing the number of tables, that have to be opened at startup.
AutoFieldsProperties property is similar to the standard AutoDisplayLabels, only it takes information about fields (Description, Format, DefaultExpression, Attributes, etc.) from the database schema.
OptimizedLookups property (default False) if set to True changes the way the lookups are handled, by avoiding multiple searches by the same set of keys. This may greatly improve lookup speed if your database defines multiple lookups, based on the same set of keys (for instance, Order table may define customer's lookups, such as LastName, FirstName, etc. based on the same CustomerID. In the standard VCL approach this will lead to LocateRecord being called for every field, while OptimizedLookups ensure, that it's only called one.)
UpdateOptions property controls which extended features (such as triggers, change tracking, constraints, etc.) are enabled for this dataset.

In addition to these options TnxQueryExt also has several properties to support Macros within SQL statements:

AllowMacros property defines, whether the SQL statement will be preprocessed for macros.
MacroBegin & MacroEnd property defines the characters that surround macro. Default values are '<%' and '%>'.
     Example: select * from <%table_name%> order by <%order_clause%>
Macros collection (filled in automatically by parsing SQL) declares the macros and allows to set up their values. You can also use MacroByName method of TnxQueryExt component.

Business Logic Components

 TDBDocumentType,  TDBDocument &  TDBJournal

Database Extensions package introduces these components to help organizing business applications, dealing with documents & journals. TDBDocumentType and TDBDocument (on instance of TDBDocumentType) define a way to handle complex document (with one or more detail data sets) as a whole. It provides functionality to help loading, saving, deleting and entering documents into journals. The logic, which defines journal entries, is coded within TDBJournal.Rules collection. TDBDocument require TDBISAMDatabaseExt component (or any other component, implementing IDatabaseExt interface) as a document storage. See EZBooks demo (TEditOrder and TEditPayment forms) for more details on using TDBDocument.

If you need more information about this product, please click here to submit your request.

 

Home  | About Us  | Products  | Downloads  | Ordering  | Contact  | My Account