Editors and views¶
pgCodeKeeper project editor¶
Project editor is the main way of working with pgCodeKeeper. The editor interface consists of several main parts:
- Eclipse tool bar
- Editor tool bar
- Differences table
- Comparison panel
- Object counter
Eclipse tool bar contains tools for working with SQL editor. The button allows you to open a new SQL editor.
Editor tool bar is used for working with the object list. There are the following opportunities:
- – select all objects.
- – deselect all the objects.
- – invert the selecting of objects.
- – copy the set of selected objects to the clipboard as a regular expression.
- – inactive / – active object filter.
- – filter list of objects by name or regular expression.
- – apply changes
- ⯆ – drop-down menu with the directions of changes. If you click the Project label, you will also see the menu with the directions of changes.
- – get changes
- ⯆ – drop-down menu with database sources. You can also select the database sources in the combo box element.
The ⯆ drop-down menus allow us to launch the operations of receiving and applying changes with overriding some settings.
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, TYPE, SEQUENCE, TABLE, FUNCTION, PROCEDURE, VIEW, CONSTRAINT, INDEX, TRIGGER.
CAST, EXTENSION, DOMAIN, OPERATOR, FTS_PARSER, FTS_TEMPLATE, FTS_DICTIONARY, FTS_CONFIGURATION, AGGREGATE, 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 and the direction of changes, objects in the list are marked as ‘delete’, ‘add’ and ‘edit’ or ‘CREATE’, ‘DROP’ and ‘ALTER’ respectively.
Container is the name of the parent object. For example, for an index, it is the name of a table or a view this index 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 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.
When using SQL-editor on the Eclipse tool bar, you will have the following options:
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.
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.
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.
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.
The 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.
Query result view displays query results. Each query is displayed in a separate tab.