prorm API Reference
    Preparing search index...

    Function generateSpatialIndexSQL

    • Generate SQL for spatial index creation.

      Mirrors the per-dialect createSpatialIndex implementations found under src/dialects/*/index.ts, and is consistent with the dialects that DataTypes.GEOMETRY/GEOGRAPHY (src/models/data-types.ts) actually generate column syntax for:

      • PostgreSQL/PostGIS: CREATE INDEX ... USING gist (col)
      • MySQL/MariaDB: CREATE SPATIAL INDEX ...
      • Oracle: CREATE INDEX ... INDEXTYPE IS MDSYS.SPATIAL_INDEX
      • MSSQL: CREATE SPATIAL INDEX ... (default grid tessellation)
      • SQLite: CREATE VIRTUAL TABLE ... USING rtree(...) (SQLite has no native spatial index — the R-Tree virtual table module is the closest equivalent)

      Parameters

      • tableName: string

        The table to index

      • columnName: string

        The spatial column to index

      • OptionalindexName: string

        Optional explicit index name

      • dialect: SpatialDialect = 'mysql'

        The target SQL dialect (defaults to 'mysql' for backwards compatibility)

      Returns string