Class Index

Classes


v1.2.1

DBChangeTrackerManager

This class provides the ability to create, retrieve, and drop "change trackers" ( DBChangeTracker ) that track and report changes to data in tables. The data changes are reported in a "transaction log" format useful for synchronization purposes.

This class can be retrieved via the DB#changeTrackers property as follows:

	var changeTrackers = db.changeTrackers;
	

The primary methods this manager provides are:

Usage Notes

Please consider the following important notes when creating change trackers:

Summary
Constructor Attributes Constructor Name and Description
This class provides the ability to create, retrieve, and drop "change trackers" ( DBChangeTracker ) that track and report changes to data in tables.
Method Summary
Method Attributes Method Name and Description
create (trackerName, tableNames)
This method creates a DBChangeTracker to record data changes to one or more tables in the database.
drop (trackerName)
This method drops a previously created DBChangeTracker .
get (trackerName)
This method retrieves a previously created DBChangeTracker by its name.
This method retrieves all current change trackers ( DBChangeTracker ) regardless of their tracking state.
Detail
DBChangeTrackerManager ()
This class provides the ability to create, retrieve, and drop "change trackers" ( DBChangeTracker ) that track and report changes to data in tables.
See:
DB#changeTrackers
DBChangeTracker
Method Detail
{ DBChangeTracker } create (trackerName, tableNames)
This method creates a DBChangeTracker to record data changes to one or more tables in the database.

The following several examples of how to create change trackers:

	db.changeTrackers.create("My_Empl_Tracker", "EMPL_TAB");
	db.changeTrackers.create("EMPL_AND_DEPT", ["EMPL_TAB", "DEPT_TAB"]);
	db.changeTrackers.create("Just_Empl_Again", ["EMPL_TAB"]);
	

Implementation Notes:

Parameters:
{string} trackerName
A unique name for the change tracker (unique among trackers). This name must abide by table name syntax rules (alphanumeric, '_' allowed, no spaces).
{string | string[]} tableNames
The names of the table(s) to track.
Returns:
{ DBChangeTracker } A DBChangeTracker object.
See:
DBChangeTracker

drop (trackerName)
This method drops a previously created DBChangeTracker .

The following is an example of how to drop a change tracker:

	db.changeTrackers.drop("My_Empl_Tracker");
	

Implementation Notes:

Parameters:
{string} trackerName
The name of the change tracker to drop.
See:
DBChangeTracker

{ DBChangeTracker } get (trackerName)
This method retrieves a previously created DBChangeTracker by its name.

The following is an example of how to retrieve a change tracker:

	var myTracker = db.changeTrackers.get("My_Empl_Tracker");
	
Parameters:
{string} trackerName
The case-insensitive name of the change tracker to retrieve.
Returns:
{ DBChangeTracker } The change tracker corresponding to that name, or null if none are found.
See:
DBChangeTracker

{ DBChangeTracker []} getAll ()
This method retrieves all current change trackers ( DBChangeTracker ) regardless of their tracking state.

The following is an example of how to retrieve all change trackers:

	var myTrackers = db.changeTrackers.getAll();
	
Returns:
{ DBChangeTracker []} An Array of the change trackers currently in existence.
See:
DBChangeTracker

©2012 Sequel Sphere, LLC.