|
| 1 | +:sectnums: |
| 2 | +:sectnumlevels: 5 |
| 3 | + |
| 4 | += DBeaver |
| 5 | + |
| 6 | +== Overview |
| 7 | + |
| 8 | +DBeaver Community is a cross-platform graphical database client. IvorySQL uses the PostgreSQL wire protocol, so DBeaver can connect with its PostgreSQL driver without an IvorySQL-specific plugin. |
| 9 | + |
| 10 | +This guide was validated on Windows 11 with DBeaver Community 26.2.0, PostgreSQL JDBC 42.7.13, and IvorySQL 5.4 (PostgreSQL 18.4). Database Navigator metadata sessions, the SQL editor, DDL, DML, UTF-8 data, transaction rollback, and execution plans were tested through the PostgreSQL-compatible port. Oracle-compatible DDL, DML, `dual`, and transaction rollback were also tested through the Oracle-compatible port. |
| 11 | + |
| 12 | +== Create a PostgreSQL-compatible connection |
| 13 | + |
| 14 | +. In DBeaver, select *Database* > *New Database Connection*. |
| 15 | +. Select *PostgreSQL* as the database driver. |
| 16 | +. Enter the connection settings: |
| 17 | + |
| 18 | +[cols="1,2"] |
| 19 | +|==== |
| 20 | +|Setting |Value |
| 21 | + |
| 22 | +|Host |
| 23 | +|IvorySQL server address, for example `127.0.0.1` |
| 24 | + |
| 25 | +|Port |
| 26 | +|The PostgreSQL-compatible port, `5432` by default |
| 27 | + |
| 28 | +|Database |
| 29 | +|Target database, for example `ivorysql` |
| 30 | + |
| 31 | +|Username |
| 32 | +|An IvorySQL login role |
| 33 | + |
| 34 | +|Password |
| 35 | +|The role password |
| 36 | +|==== |
| 37 | + |
| 38 | +. If prompted, allow DBeaver to download the PostgreSQL JDBC driver. |
| 39 | +. Select *Test Connection*, then *Finish*. |
| 40 | + |
| 41 | +The equivalent JDBC URL is: |
| 42 | + |
| 43 | +[source,text] |
| 44 | +---- |
| 45 | +jdbc:postgresql://127.0.0.1:5432/ivorysql |
| 46 | +---- |
| 47 | + |
| 48 | +== Validate the connection |
| 49 | + |
| 50 | +Open an SQL editor for the connection and run: |
| 51 | + |
| 52 | +[source,sql] |
| 53 | +---- |
| 54 | +SELECT version(); |
| 55 | +
|
| 56 | +CREATE TABLE dbeaver_validation ( |
| 57 | + id integer PRIMARY KEY, |
| 58 | + label text NOT NULL |
| 59 | +); |
| 60 | +INSERT INTO dbeaver_validation VALUES (1, 'IvorySQL'), (2, '北京'); |
| 61 | +SELECT * FROM dbeaver_validation ORDER BY id; |
| 62 | +
|
| 63 | +EXPLAIN SELECT * FROM dbeaver_validation WHERE id = 1; |
| 64 | +---- |
| 65 | + |
| 66 | +Refresh the `public` schema in Database Navigator. The table and its two columns should appear. Use *Data* > *View Data* to inspect or edit rows. |
| 67 | + |
| 68 | +To verify transaction control, disable auto-commit, insert a row, select *Rollback*, and confirm that the row is absent. |
| 69 | + |
| 70 | +== Connect to the Oracle-compatible port |
| 71 | + |
| 72 | +Create a second connection with the same PostgreSQL driver and database settings, but use the IvorySQL Oracle-compatible port (`1521` by default). This remains a PostgreSQL JDBC connection; the different port selects IvorySQL's Oracle-compatible SQL mode. |
| 73 | + |
| 74 | +[source,text] |
| 75 | +---- |
| 76 | +jdbc:postgresql://127.0.0.1:1521/ivorysql |
| 77 | +---- |
| 78 | + |
| 79 | +Validate Oracle-compatible syntax in the SQL editor: |
| 80 | + |
| 81 | +[source,sql] |
| 82 | +---- |
| 83 | +SELECT 1 FROM dual; |
| 84 | +
|
| 85 | +CREATE TABLE dbeaver_ora_validation ( |
| 86 | + id NUMBER PRIMARY KEY, |
| 87 | + label VARCHAR2(40) |
| 88 | +); |
| 89 | +INSERT INTO dbeaver_ora_validation VALUES (1, 'IvorySQL'); |
| 90 | +SELECT * FROM dbeaver_ora_validation; |
| 91 | +DROP TABLE dbeaver_ora_validation; |
| 92 | +---- |
| 93 | + |
| 94 | +Alternatively, use the PostgreSQL-compatible connection and switch only the current session: |
| 95 | + |
| 96 | +[source,sql] |
| 97 | +---- |
| 98 | +SET ivorysql.compatible_mode=oracle; |
| 99 | +SELECT 1 FROM dual; |
| 100 | +---- |
| 101 | + |
| 102 | +== Notes and limitations |
| 103 | + |
| 104 | +* DBeaver identifies IvorySQL as PostgreSQL. PostgreSQL navigation, metadata, editing, and plan features are available; Oracle-specific DBeaver administration panels are not expected. |
| 105 | +* A `SET ivorysql.compatible_mode` command applies only to its current database session. A dedicated Oracle-port connection avoids mode changes when DBeaver opens additional metadata or editor sessions. |
| 106 | +* Preserve the case of quoted Oracle-compatible identifiers. Unquoted identifier folding differs between compatibility modes. |
| 107 | +* Do not save production passwords on shared workstations. Prefer TLS and the authentication method required by your deployment. |
| 108 | +* For production connections, consider enabling DBeaver's read-only and SQL execution restrictions to reduce accidental changes. |
| 109 | + |
| 110 | +See the https://dbeaver.com/docs/dbeaver/Database-driver-PostgreSQL/[DBeaver PostgreSQL driver documentation] for advanced SSL, SSH, proxy, and driver settings. |
0 commit comments