[QGIS-Developer] (QGIS 2020 Grant Report) Port DB Manager Table Management Functionalities to Browser (part 2)

Alessandro Pasotti apasotti at gmail.com
Tue Sep 29 00:14:31 PDT 2020


Hi,

this is the final report about the implementation of the QEP
https://github.com/qgis/QGIS-Enhancement-Proposals/issues/171

The QGIS browser now exposes a new "Fields" item for vector layers
that can be expanded to show the underlying fields, an icon identifies
the base field type.

A context menu is available at the fields root level and allows you to
create a new field.
A context menu is available at the individual fields level and allows
you to delete the selected field.

At the connection level a new context menu item is available and
allows you to create a new table for all DB connections that support
the Connections API:
- PG
- Spatialite
- GPKG
- MSSQL

All the new functions are implemented using the new connections API
and exposed to Python for plugins/scripts.

There have been many other small improvements in the API and in the
browser as part of this work such as homogenization of the
error/warning/success reporting (now using the message bar if
available and falling back to a dialog if it is not available) and new
context menu entries.

The following functions are now available in the browser tree using a
common abstraction API:

- create a new schema
- delete a schema
- rename a schema
- create a new table/layer
- rename table/layer
- delete a table/layer
- truncate a table/layer
- refresh a materialized view
- list fields for a table/view
- add a new field
- delete a field

Thank you to the QGIS project and to all QGIS sponsors and donors that
made this possible, a special thank goes to Nyall Dawson who helped in
the design of the API and reviewed the code.

Kind regards.

-- 
Alessandro Pasotti
QCooperative:  www.qcooperative.net
ItOpen:   www.itopen.it


More information about the QGIS-Developer mailing list