Screens: Connections and explorer

Object tabs

An object tab is a work document tab that opens database objects other than tables. You see objects such as views, functions and procedures, sequences, triggers, packages, synonyms, types and users as a list, and pick one to view and edit its definition and properties. Unlike tables, what you edit here is not saved to the project; it goes to the database as soon as you run it (indexes are the exception, see 'Indexes' below).

Where you can use itWebDesktopWithout signing inSigned inLocal projectsAccount projects

What's on the screen

No.NameDescription
1TitleThe object kind, and the connection, database and schema.
2List buttonsButtons for the list, such as the Refresh button, the Delete button that deletes the selected objects, and the Create button that creates a new object. They differ by object kind and DBMS.
3ListOne object of that kind per row. Filter with the Filter objects... field, and select several rows to delete them at once.
4Detail buttonsButtons for the selected object, such as the Save and Compile buttons. Some can be clicked only when you have edited something.
5DetailsThe selected object's definition and properties. Edit the editable fields in place.
6Detail tabsInformation attached to the selected object, such as source, DDL, columns, privileges and dependencies. They differ by kind and DBMS.
  • Drag the border between the list and the details to change their heights, and double-click it to collapse or expand the list.
  • In the work document tab bar, the tab carries the object kind's name (SEQUENCE, TRIGGER and so on) as a badge.

Opening an object tab

  1. In the explorer, expand a schema and double-click an object kind item such as Sequences or Triggers. The list of that kind opens as an object tab (Document tabObject details).
  2. Expand an object kind item and double-click one object to open the tab with that object selected.
  3. For a view, double-click the view under Views. The view's object tab (Document tabView) opens.

Functions and procedures are grouped under the Routines item. Objects that belong to the whole server (users, roles, tablespaces and so on) are under the connection's Server Objects item. The session and lock screens are described in Sessions, locks and server status.

Objects per DBMS

The object kinds in the explorer, and which of them NeoSQL can create, differ per DBMS.

DBMSObjects you can viewObjects you can create
PostgreSQLIndexes, functions, procedures, sequences, triggers, types, foreign tables, extensions, foreign servers, FDWs, users, tablespacesIndexes, sequences, triggers, types, foreign tables, extensions, foreign servers, users, tablespaces
MySQLIndexes, functions, procedures, triggers, events, users, engines, character setsIndexes, triggers, events, users
MariaDBSame as MySQL, plus sequencesSame as MySQL, plus sequences
OracleIndexes, sequences, packages, procedures, functions, synonyms, types, triggers, database links, scheduler (jobs, programs, schedules), users, roles, tablespaces, public synonyms, public database linksIndexes, sequences, synonyms, types, triggers, database links, scheduler jobs, programs and schedules, users, tablespaces, public synonyms, public database links
SQL ServerIndexes, sequences, procedures, functions, triggers, synonyms, types, external tables, external data sources, logins, database usersIndexes, triggers, synonyms, types, logins, database users
SQLiteIndexes, triggersIndexes, triggers
H2Indexes, sequencesIndexes, sequences
  • Views can be viewed in every DBMS, and their definitions edited and saved. Views, functions, procedures and packages are not created in this tab. Run a CREATE statement in the SQL editor. Oracle packages can be selected in the list and removed with the Delete button (DROP PACKAGE, which removes both the specification and the body).
  • Even for the same kind, the detail fields and detail tabs differ per DBMS. For example, Oracle functions, procedures and packages have a Compile button, and Oracle users have buttons to lock and unlock the account.

Creating an object

  1. In the explorer, right-click an object kind item and click the Explorer context menuCreate ... menu. The menu name includes the object kind (for example Create Sequence). Clicking the Create button (2) of the object tab does the same.
  2. Enter the name and properties in the window that opens.
  3. Check the generated CREATE statement in the SQL Preview window and click the Execute button. For objects such as triggers that fill in a template, edit the statement directly in the SQL Preview window.
  • The menu appears only for object kinds that the DBMS lets you create. In a system schema it is dimmed and cannot be clicked. It does not appear on a connection without database access details.
  • For types, a window opens where you choose the kind in PostgreSQL (ENUM, domain, composite, range), Oracle (object, collection) and SQL Server (alias, table type), and enter the definition for that kind.
  • When you lack the privilege to create (for example without the CREATE USER privilege in Oracle), the button is disabled and the reason is shown.

Editing and deleting objects

  1. Click an object in the list.
  2. Edit the detail fields or the code in the source tab.
  3. Click the Save or Apply button among the detail buttons.
  4. In the SQL Preview window, check what changed and the statement that will run, and click the Execute button.
  • To delete, select rows in the list and click the Delete button. This also previews the DROP statement before running it. For kinds such as sequences, tablespaces and roles that have no delete button in the list, delete with the Delete button in the details.
  • In the SQL Preview window, the Open Editor button moves the statement to a new SQL editor tab and the Copy SQL button copies it. If you want to adjust the statement before running it, move it to the editor and run it there.
  • To enable or disable a trigger, change the status field in the details and click the Save button. Oracle scheduler jobs are run, enabled and disabled directly with the Run, Enable and Disable buttons.

Indexes

Unlike other objects, indexes are part of the table design. Adding, editing or deleting an index in the Indexes object tab saves it to the project, and the database does not change. It reaches the database only when you click the Apply Changes to DB button in the header, preview the DDL and run it. Discard changes not yet applied with the Reset Changes button. The Indexes area of the Table tab shows the same indexes.

Views

A view's object tab has source, columns, data and properties tabs, and in PostgreSQL and Oracle also indexes, triggers, privileges and dependencies tabs.

  • Edit the definition in the source tab and click the Save button to preview and run the statement that recreates the view.
  • The data tab queries the view. Rows can be edited only for updatable views in MySQL and MariaDB.

PostgreSQL foreign data (FDW)

In PostgreSQL, the Extensions, Foreign Data Wrappers and Foreign Servers items under the database node and the Foreign Tables item under a schema handle the setup for using another database's data as tables. The usual order is installing the extension, the foreign server, the user mapping, then the foreign table.

What you createWhereWhat you enter
ExtensionThe Create button of the Extensions object tabExtension name, version, schema and whether to CASCADE
Foreign serverThe Create button of the Foreign Servers object tabServer name, an installed FDW, host, port, database and other options. There is a Test Connection button
User mappingRight-click the User Mappings item under a foreign server › the Explorer context menuCreate User Mapping menuLocal user (CURRENT_USER, PUBLIC or a role), remote user and password
Foreign tableThe Create button of the Foreign Tables object tabName, foreign server, columns, constraints, options and privileges
  1. In the explorer, expand a foreign server, right-click its User Mappings item and click the Explorer context menuCreate User Mapping menu.
  2. Choose the local user, and enter the user and password for connecting to the remote server.
  3. When you confirm, the SQL Preview window opens. Check the CREATE USER MAPPING statement and the plain-text password warning, then click the Execute button.
  • To edit an existing user mapping, right-click it and click the Explorer context menuEdit User Mapping menu. An ALTER USER MAPPING statement runs after the same preview window.
  • The foreign server's object tab also has a user mappings tab, whose add button opens the same window. That path also goes through the SQL Preview window before running.

Things to keep in mind

  • For every object except indexes, the database changes the moment you click the Execute button. Nothing is recorded in the project and there is no undo button, so check the statement in the preview.
  • Detail edits stay only in this tab until you run them, and are not saved to the project.
  • Running an edited definition of a function, procedure or view replaces the existing definition. Check first whether other objects and programs that use it are affected.
  • The remote password of a user mapping is stored in plain text in PostgreSQL's pg_user_mapping. Creating or editing one shows this warning in the SQL Preview window.
  • In a signed-in account project, a member whose DDL execution is restricted cannot run statements in the SQL Preview window (You do not have permission to execute DDL.). Views and indexes are exceptions.
  • The list shows the state when it was opened. If objects were changed elsewhere, read it again with the Refresh button.