User Tools

Site Tools


statement_level_merging

Statement Level Merging

In general Lure source files will contain more than one DDL statement per file. However, Lure merges source between the database and source files at a statement level.

Export Merging

Export merges DDL statements from the database to files as follows:

  • Objects from the database are mapped to folders and files as configured in the main.lure-config file.
  • If a file does not exist it is created (together with the directory parent tree).
  • If the DDL for an an object in the database does not have a corresponding statement in the file, this statement will be added to the file.
  • Any DDL statement in an existing source file that cannot be mapped to an object/statement in the database is removed from the source file.
  • If the DDL for an object in the database is different from the statement in the corresponding source file then the statement in the file will be replaced with the database version.
  • If no object in the database can be mapped to a file then all statements will be removed from this file. The file itself will however never be deleted.
  • If a file is passed as an argument but the file does not exist and no objects exist in the database corresponding to this file, then this argument will be ignored and the file will not be created.
  • Objects with an invalid status in the database will be exported as always but the invalid status will logged to the console.

Import Merging

Import merges DDL statements from files to the database as follows:

  • Objects from the database are mapped to folders and files as configured in the main.lure-config file.
  • Only objects corresponding to files that actually exist on the file system will be processed.
  • If a file contains a DDL statement but the corresponding object does not exist in the database then the statement will be executed in order to create the object.
  • If an object exists in the database corresponding to a file that was selected for Import, but the corresponding statement in the file does not exist, then the object will be removed/dropped from the database.
  • Similarly, where an object in the database does correspond to a statement in a file but the statement in the file is different from the corresponding DDL of the object in the database, then the object in the database will be updated to match the statement in the file.
  • Arguments denoting files that don't exist are ignored.
statement_level_merging.txt · Last modified: 2013/07/25 21:00 (external edit)

Page Tools