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
| Attribute | Type | Description |
|---|---|---|
| db_module | string = django.contrib.gis.db | The 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
| Name | Type | Description |
|---|---|---|
| connection | DatabaseConnection | The active database connection object used to perform schema introspection. |
| table_name | string | The name of the database table containing the column being inspected. |
| row | list | The raw column metadata row returned by the database cursor's description. |
Returns
| Type | Description |
|---|---|
tuple | A tuple containing the specific geometry field class name, a dictionary of field configuration parameters, and a list of generated notes. |