Skip To Content

Create SQLite Database


Creates an ST_Geometry, a SpatiaLite, or a GeoPackage database.


  • The output Output Database Name will be automatically assigned an extension based on the value of the Spatial Type parameter. If the spatial type is ST_Geometry or SpatiaLite, the output name will have an .sqlite extension. If the spatial type is GeoPackage, the output name will have a .gpkg extension.


CreateSQLiteDatabase(out_database_name, {spatial_type})
ParameterExplanationData Type

Location of the SQLite database to be created and the name of the SQLite database file. An extension of .sqlite will be automatically assigned if the spatial_type is ST_GEOMETRY or SPATIALITE. If the spatial_type is GEOPACKAGE, a .gpkg extension is automatically assigned.


The spatial type to install with the new SQLite database.

  • ST_GEOMETRYEsri's spatial storage type. This is the default.
  • SPATIALITESpatiaLite spatial storage type.
  • GEOPACKAGE OGC GeoPackage dataset. Creates a GeoPackage 1.2.1 dataset.
  • GEOPACKAGE_1.0OGC GeoPackage 1.0 dataset.
  • GEOPACKAGE_1.1OGC GeoPackage 1.1 dataset.
  • GEOPACKAGE_1.2OGC GeoPackage 1.2.1 dataset.

Code sample

CreateSQLiteDatabase example 1 (Python window)

The following Python window script demonstrates how to use the CreateSQLiteDatabase tool in immediate mode.

import arcpy
arcpy.CreateSQLiteDatabase_management('c:/data/example.gpkg', 'GEOPACKAGE_1.2')
CreateSQLiteDatabase example 2 (stand-alone script)

The following stand-alone script demonstrates how to use the CreateSQLiteDatabase tool.

import arcpy

# Execute CreateSQLiteDatabase
arcpy.CreateSQLiteDatabase_management('C:/data/example.sqlite', 'ST_GEOMETRY')


Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics