User Tools

Site Tools


Include and Exclude Filters

Setting Up Filter Patterns

During export Lure applies all include/exclude filters as set up in the Lure property files.

The easiest way to set up the include/exclude filters is to use the Configuration Editor within Lure Stage. Each object type (e.g. tables or views) has its own set of filters. Each parameter (for each object type) can be set to a comma separated list of patterns to match. Lure matches filter patterns on the names of extracted source files but excluding the extension.

Filter patterns can be configured using the characters “*” and ”?”, where “*” matches zero or more characters and ”?” matches a single character. For example the setting:

app.include.table = PR_*,TR_* 

means that all tables source files with names starting with either “PR_” or “TR_” will be included during export. Since the names of source files for tables (excluding the extension) match the names of the tables this effectively means that tables with names starting with either “PR_” or “TR_” will be included.

app.exclude.index = TMP_*,TEST_?

In this case, since an index is stored in a source file with name (excluding extension) matching the name of the table on which the index is created, this setting will exclude all indexes on tables starting with “TMP_” or indexes on tables with names like “TEST_1” or “TEST_X”.

Include Filters

With the exception of files for table data, all include patterns for source files default to “*”. In other words by default all object types (except for table data) will be included in the export. The filter values can be changed from this default value by setting the corresponding properties using the Lure Configuration Editor.

Include filters properties are set in the Lure config properties file. This implies that include filters are set globally for all database environments.

Exclude Filters

By default all exclude filters for all object types are unset, in other words no exclude filters are applied.

Exclude filter properties can be set either in the Lure config file (global excludes) or in the Lure connect property file (local excludes) or in both. In other words the project lead can set up global exclude filters in the config file, to be applied to all environments. In addition each developer can add his/her own local exclude patterns to the connect file.

Overriding Filters

Note that filters are only applied during export and then only if the source file does not exist on the local file system. This has the following implications:

  1. If an exclude filter pattern is added for a file after it has already been exported (and therefore exists on the file system) the Lure export command will ignore the exclude filter for that file and continue to export the source for the file as before.
  2. In order for the exclude pattern to be applied to this file, first manually delete the file. During subsequent export operations the exclude pattern will be applied to the file as it is not present on the file system.
  3. Any exclude or include pattern can be permanently overridden for any file by just manually creating the file with the correct name in the correct folder. During subsequent export operations this file will be updated.

This behaviour of filters is intended so that sensible filters can be set up globally by the technical lead but can still be overridden by each individual developer.

Another case where this behaviour is useful is for table data files. By default no data files for tables will be exported. This is desirable since generally it does not make sense to have table data in the version control system. But in many database applications there is a small subset of tables that contain meta data which need to be the same in all instances of the application and typically only change with new releases of the application. In order to add the data for these meta data tables to the version control system simply create the data files for these tables manaullly. Subsequent Lure export operations will export the table data to the file.

Alternatively use the command option --ignore-filters to override the filters.

include_and_exclude_filters.txt · Last modified: 2013/07/29 19:03 by admin

Page Tools