Back to 5.0.0-doc main page
about GetDbObjectScope()
Starting since version 5.0.0 libspatialite supports a new SQL function surely useful for all third-parties intending to develop their own custom interfaces for managing SQLite+SpatiaLite databases adopting a style more or less similar to the one implemented by spatialite_gui and may be using some programming language such as C/C++, Java, Python or whatever else.The new function is named GetDbObjectScope(), and will return a short but clear description about the intended scope of each DB object defined within a currently connected database.
The following categories of DB objects are supported:
- Tables
- Views
- Indices
- Triggers
and will be classified into one of the following groups:
- system: AutoIndex
- system: CRS Catalog
- system: Elementary Geometries Interface
- system: Geometry Constraints Check (trigger)
- system: Internal Constraints Check (trigger)
- system: Internal Index
- system: KNN Interface
- system: Networks Catalog
- system: Raster Coverages Catalog
- system: Raster/Vector Coverages Auxiliary
- system: Reserved for future use
- system: SLD/SE Styling
- system: SQL log
- system: SQLite's own
- system: Spatial Index Component
- system: Spatial Index Interface
- system: Spatial Index
- system: Spatial Tables Catalog
- system: Spatial Views Catalog
- system: Spatial Virtual Tables Catalog
- system: Statistics
- system: Stored Procs Catalog
- system: Topologies Catalog
- system: Vector Coverages Catalog
- system: WMS Coverages Catalog
- userland: Index
- userland: Spatial Table
- userland: Spatial View
- userland: Table
- userland: View
Syntax
GetDbObjectScope ( db-prefix Text , obj-name Text ) : Text |
- the first argument db-prefix is the symbolic prefix of the attached DB containing the required DB object.
It can be legitimately NULL, and in this case the MAIN DB will be always assumed. - the second argument obj-name is the name of some specific DB object.
- the returned value will be one of the above Scope groups.
Note: NULL will be returned on invalid arguments or when attempting to query any DB object that does not exist.
A practical example
SELECT type, name, GetDBObjectScope(NULL, name) AS object_scope FROM sqlite_master;The above SQL query will classify all DB objects defined within the MAIN DB.
The following table corresponds to a simplified excerpt of the returned resultset.
type | name | object_scope |
---|---|---|
table | spatial_ref_sys | system: CRS Catalog |
index | idx_spatial_ref_sys | system: Internal Index |
table | spatialite_history | system: SQL log |
table | sqlite_sequence | system: SQLite's own |
table | geometry_columns | system: Spatial Tables Catalog |
index | sqlite_autoindex_geometry_columns_1 | system: AutoIndex |
index | idx_srid_geocols | system: Internal Index |
trigger | geometry_columns_f_table_name_insert | system: Internal Constraints Check (trigger) |
trigger | geometry_columns_f_table_name_update | system: Internal Constraints Check (trigger) |
view | geom_cols_ref_sys | system: CRS Catalog |
table | spatial_ref_sys_aux | system: CRS Catalog |
view | spatial_ref_sys_all | system: Spatial Tables Catalog |
table | views_geometry_columns | system: Spatial Views Catalog |
table | virts_geometry_columns | system: Spatial Virtual Tables Catalog |
table | geometry_columns_statistics | system: Statistics |
table | data_licenses | system: Raster/Vector Coverages Auxiliary |
table | sql_statements_log | system: SQL log |
table | SpatialIndex | system: Spatial Index Interface |
table | ElementaryGeometries | system: Elementary Geometries Interface |
table | KNN | system: KNN Interface |
table | raster_coverages | system: Raster Coverages Catalog |
table | topologies | system: Topologies Catalog |
table | networks | system: Networks Catalog |
view | vector_coverages_ref_sys | system: Vector Coverages Catalog |
table | vector_coverages_keyword | system: Vector Coverages Catalog |
table | SE_external_graphics | system: SLD/SE Styling |
table | SE_fonts | system: SLD/SE Styling |
table | SE_vector_styles | system: SLD/SE Styling |
table | SE_raster_styles | system: SLD/SE Styling |
table | wms_getcapabilities | system: WMS Coverages Catalog |
table | wms_getmap | system: WMS Coverages Catalog |
table | wms_settings | system: WMS Coverages Catalog |
table | wms_ref_sys | system: WMS Coverages Catalog |
table | stored_procedures | system: Stored Procs Catalog |
table | stored_variables | system: Stored Procs Catalog |
table | tpl_users | userland: Table |
table | tpl_admin_l1 | userland: Spatial Table |
trigger | ggi_tpl_admin_l1_geom | system: Geometry Constraints Check (trigger) |
trigger | ggu_tpl_admin_l1_geom | system: Geometry Constraints Check (trigger) |
table | idx_tpl_admin_l1_geom | system: Spatial Index |
table | idx_tpl_admin_l1_geom_rowid | system: Spatial Index Component |
table | idx_tpl_admin_l1_geom_node | system: Spatial Index Component |
table | idx_tpl_admin_l1_geom_parent | system: Spatial Index Component |
view | tplvw_admin_l2 | userland: Spatial View |
view | tplvw_admin_l3 | userland: Spatial View |
view | tplhsvw_admin_l1 | userland: View |
view | tplhsvw_admin_l2 | userland: View |
view | tplvw_popplaces | userland: Spatial View |
Back to 5.0.0-doc main page