Contents Id
This extension assigns a unique integer identifier to tables defined in the contents. Allows foreign key referencing to a contents (text based primary key) by an integer identifier. This extension is required because the gpkg_contents
table "rowid table" rowid
values are "not persistent and might change".
"If the rowid is not aliased by INTEGER PRIMARY KEY then it is not persistent and might change. In particular the VACUUM command will change rowids for tables that do not declare an INTEGER PRIMARY KEY. Therefore, applications should not normally access the rowid directly, but instead use an INTEGER PRIMARY KEY."
National Geospatial-Intelligence Agency, author_name nga
nga_contents_id
New Requirement
This extension applies to the table names of tables defined in the contents (1.1.3).
Read-write
The Contents Id extension is registered into the gpkg_extensions
table only once as follows:
table_name | column_name | extension_name | definition | scope |
---|---|---|---|---|
null |
null |
|
URL to this extension description |
read-write |
The Contents Id Table contains an integer id and contents table name.
Column Name | Type | Description | Null | Default | Key |
---|---|---|---|---|---|
|
INTEGER |
Autoincrement primary key |
no |
PK |
|
|
TEXT |
The name of the actual content table, foreign key to |
no |
FK,UK |
CREATE TABLE nga_contents_id (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
table_name TEXT NOT NULL,
CONSTRAINT uk_nci_table_name UNIQUE (table_name),
CONSTRAINT fk_nci_gc_tn FOREIGN KEY (table_name) REFERENCES gpkg_contents(table_name)
);
The Contents Id Table defines a Contents row (2.4.2). This is required for use in the Related Tables Extension.
table_name | data_type | identifier | description | last_change | min_x | min_y | max_x | max_y | srs_id |
---|---|---|---|---|---|---|---|---|---|
nga_contents_id |
gpkg_extensions |
nga_contents_id |
date of last change |
None
None
The rivers GeoPackage has a contents id for the rivers
feature table.
The example GeoPackage has contents id entries for all feature tables.