Skip to main content

Command

This class extends the database inspection functionality to provide specialized support for geographic information systems (GIS). It overrides field type detection to identify specific geometry types and spatial parameters from the database backend during the introspection process. This ensures that spatial columns are correctly mapped to their corresponding geometry field types rather than a generic geometry field.

Attributes

AttributeTypeDescription
db_modulestring = django.contrib.gis.dbThe Python path to the database module used for spatial database introspection.

Methods


get_field_type()

@classmethod
def get_field_type(
connection: DatabaseConnection,
table_name: string,
row: list
) - > tuple

Determines the specific GIS field type and associated spatial parameters for a given database column.

Parameters

NameTypeDescription
connectionDatabaseConnectionThe active database connection object used to perform schema introspection.
table_namestringThe name of the database table containing the column being inspected.
rowlistThe raw column metadata row returned by the database cursor's description.

Returns

TypeDescription
tupleA tuple containing the specific geometry field class name, a dictionary of field configuration parameters, and a list of generated notes.