Views and editors

pgCodeKeeper project editor

Project editor is the main way of working with pgCodeKeeper. The editor interface consists of several main parts:

  1. Eclipse tool bar
  2. Editor tool bar
  3. Differences table
  4. Comparison panel
  5. Object counter
_images/main_view.png

Eclipse tool bar contains tools for selecting the source of data you are going to work with.

Editor tool bar is used for working with the object list. There are the following opportunities:

  • check_all – select all objects.
  • uncheck_all – deselect all the objects.
  • loop_obj – invert the selecting of objects.
  • copy_edit – copy the set of selected objects to the clipboard as a regular expression.
  • empty_filter / filter_tsk - disabled / enabled object filter.
  • List of objects filter by name or regular expression.
  • Apply changes to the project
  • Apply changes to the database
  • Get changes

Diff table shows the list of objects different for the DB schemas under comparison. Here you can find the info on object type, change type, object name, container, git user, database user.

Object type - the following object types are supported: SCHEMA, FUNCTION, PROCEDURE, TABLE, VIEW, CONSTRAINT, INDEX, TRIGGER.

TYPE, DOMAIN, OPERATOR, FTS_PARSER, FTS_TEMPLATE, FTS_DICTIONARY, FTS_CONFIGURATIO, RULE are supported additionally for PostgreSQL.

USER, ROLE, ASSEMBLY are supported additionally for MS SQL.

Change type - an object can be in one of three conditions: exist only in a database, only in a project, or in both a project and a database. Depending on the condition, objects in the list are marked as ‘remote’, ‘project’ and ‘edit’ respectively.

Container - parent object name. For example, for an index it is the name of the table it belongs to.

Git user - name of the user, who was the last one to change the project file for this object. In case if the files were changed locally, you’ll see a ‘*’ next to the username. To see this column, you should connect the project to the version control system and enable the corresponding option on the Project editor settings page.

Database user - name of the database user who was the last one to change the object in the database. To display this column, you’ll need the pg_dbo_timestamp extension.

Comparison panel shows changes which took place in SQL view of an object.

Object counter shows the selected and the total number of objects in the table.

SQL editor

SQL editor is not different from a regular Eclipse text editor appearance-wise, but it has functions of SQL syntax highlighting, SQL requests template autofilling and database schema objects navigation.

_images/autocomplete.png

During work in SQL editor, the following functions are present on the upper toolbar:

quick_update - Quick update. Execution of the migration script for differences between the object in the current file of the project and the respective object in the database. If the changes concern objects from other files or modify the data (for example, delete a column), there will be no update.
update_ddl - Execute selection. Execution of the current migration script (or the highlighted text) in the selected database.
progress_stop - Cancel execution. Cancel of execution of the current migration script.
refresh - Get changes. Refreshes the editor of the project containing the current file. Applicable to project files only.

Viewing the dependences of DB objects

The pg Dependencies view shows the dependencies containing the current object selected on the diff panel of the active project editor.

_images/pg_depend.png

The arrows show the direction of connection of the dependant object towards its dependence.

The Project - Remote switch allows you to select the database under comparison for which you want to display objects and dependencies. After switching, you should select the element on the editor diff panel once again.

Add depcy allows you to open the dialog of manual adding of the dependencies.

_images/manual_depcies.png

In this window, you can directly set the dependences between the DB objects. This may prove useful, for example, in case if automated recognition won’t work for certain complex dependences. The added differences will be taken into consideration during generating the expression sequences for the migration script.

The window consists of two parts which serve for adding the dependences to the DB under comparison.

To add dependencies between objects, simply start entering the first letters of the object name, select the names of the dependent objects in the drop-down list and click Add. You’ll see the dependency in the list of added.

To remove a chain of dependent objects, highlight it and click Remove.

Overwriting objects

The Object overrides view displays the list of overridden objects in libraries for the active project editor. This view is displayed automatically when receiving changes if there is at least one conflict present.

_images/override_view.png

The sync button shows the notes concerning only the objects selected on the differences panel of the active project editor.

Right-click menu allows you to open both versions of the object, as well as to view the differences in a dedicated comparison editor.