Outdated version of the documentation. Find the latest one here.

` `

Plugin Pengelola DB

The DB Manager Plugin is officially part of the QGIS core and is intended to be the main tool to integrate and manage spatial database formats supported by QGIS (PostGIS, SpatiaLite, GeoPackage, Oracle Spatial, Virtual layers) in one user interface. The dbManager DB Manager Plugin provides several features. You can drag layers from the QGIS Browser into the DB Manager, and it will import your layer into your spatial database. You can drag and drop tables between spatial databases and they will get imported.

../../../_images/db_manager.png

DB Manager dialog

Menu Basisdata memungkinkan untuk terhubung ke basisdata yang sudah ada, untuk memulai SQL-Window dan untuk keluar dari Plugin Pengeloa DB. Satu Anda terhubung ke basisdata yang sudah ada, menu Skema dan Tabel tambahan muncul.

Menu Skema termasuk alat untuk membuat dan menghapus (kosong) skema dan, jika topologi tersedia (seperti PostGIS 2) untuk memulai TopoViewer.

The Table menu allows you to create and edit tables and to delete tables and views. It is also possible to empty tables and to move tables from one schema to another. As further functionality, you can perform a VACUUM and then an ANALYZE for each selected table. Plain VACUUM simply reclaims space and makes it available for reuse. ANALYZE updates statistics to determine the most efficient way to execute a query. Finally, you can import layers/files, if they are loaded in QGIS or exist in the file system. And you can export database tables to shape with the Export File feature.

The Tree window lists all existing databases supported by QGIS. With a double-click, you can connect to the database. With the right mouse button, you can rename and delete existing schemas and tables. Tables can also be added to the QGIS canvas with the context menu.

Jika terkoneksi ke sebuah basisdata, jendela utama dari Pengelola DB menyediakan tiga tab. Tab Info memberikan informasi tentang tabel dan geometri serta tentang kolom yang ada, Kendala dan Indeks. Hal ini juga memungkinkan untuk menjalankan Vacuum Analis dan untuk membuat indeks spasial pada tabel yang dipilih, jika belum melakukannya. Tab Tabel menampilkan semua atribut dan tab Pratinjau render geometri sebagai pratinjau.

Working with the SQL Window

You can also use the DB Manager to execute SQL queries against your spatial database and then view the spatial output for queries by adding the results to QGIS as a query layer. It is possible to highlight a portion of the SQL and only that portion will be executed when you press F5 or click the Execute (F5) button.

../../../_images/db_manager_sql.png

Executing SQL queries in the DB Manager SQL window

Catatan

The SQL Window can also be used to create Virtual Layers. In that case, instead of selecting a database, select QGIS Layers under Virtual Layers before opening the SQL Window. See Creating virtual layers for instructions on the SQL syntax to use.