mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-15 21:14:10 +02:00
Run cog and add some help text.
This commit is contained in:
parent
36518cbfcd
commit
6aab06e6ec
2 changed files with 66 additions and 5 deletions
|
|
@ -772,8 +772,10 @@ See :ref:`cli_create_database`.
|
|||
sqlite-utils create-database trees.db
|
||||
|
||||
Options:
|
||||
--enable-wal Enable WAL mode on the created database
|
||||
-h, --help Show this message and exit.
|
||||
--enable-wal Enable WAL mode on the created database
|
||||
--init-spatialite Enable SpatiaLite on the created database
|
||||
--load-extension TEXT SQLite extensions to load
|
||||
-h, --help Show this message and exit.
|
||||
|
||||
|
||||
create-table
|
||||
|
|
@ -1226,4 +1228,49 @@ See :ref:`cli_drop_view`.
|
|||
-h, --help Show this message and exit.
|
||||
|
||||
|
||||
add-geometry-column
|
||||
===================
|
||||
|
||||
::
|
||||
|
||||
Usage: sqlite-utils add-geometry-column [OPTIONS] DB_PATH TABLE COLUMN_NAME
|
||||
|
||||
Add a SpatiaLite geometry column to an existing table. Requires SpatiaLite
|
||||
extension.
|
||||
|
||||
By default, this command will try to load the SpatiaLite extension from usual
|
||||
paths. To load it from a specific path, use --load-extension.
|
||||
|
||||
Options:
|
||||
-t, --type [POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION|GEOMETRY]
|
||||
Specify a geometry type for this column.
|
||||
[default: GEOMETRY]
|
||||
--srid INTEGER Spatial Reference ID. See
|
||||
https://spatialreference.org for details on
|
||||
specific projections. [default: 4326]
|
||||
--dimensions TEXT Coordinate dimensions. Use XYZ for three-
|
||||
dimensional geometries.
|
||||
--not-null Add a NOT NULL constraint.
|
||||
--load-extension TEXT SQLite extensions to load
|
||||
-h, --help Show this message and exit.
|
||||
|
||||
|
||||
create-spatial-index
|
||||
====================
|
||||
|
||||
::
|
||||
|
||||
Usage: sqlite-utils create-spatial-index [OPTIONS] DB_PATH TABLE COLUMN_NAME
|
||||
|
||||
Create a spatial index on a SpatiaLite geometry column. The table and geometry
|
||||
column must already exist before trying to add a spatial index.
|
||||
|
||||
By default, this command will try to load the SpatiaLite extension from usual
|
||||
paths. To load it from a specific path, use --load-extension.
|
||||
|
||||
Options:
|
||||
--load-extension TEXT SQLite extensions to load
|
||||
-h, --help Show this message and exit.
|
||||
|
||||
|
||||
.. [[[end]]]
|
||||
|
|
|
|||
|
|
@ -2746,10 +2746,24 @@ To load it from a specific path, use --load-extension.""",
|
|||
case_sensitive=False,
|
||||
),
|
||||
default="GEOMETRY",
|
||||
help="Specify a geometry type for this column.",
|
||||
show_default=True,
|
||||
)
|
||||
@click.option("--srid", type=int, default=4326)
|
||||
@click.option("--dimensions", "coord_dimension", type=str, default="XY")
|
||||
@click.option("--not-null", "not_null", is_flag=True)
|
||||
@click.option(
|
||||
"--srid",
|
||||
type=int,
|
||||
default=4326,
|
||||
show_default=True,
|
||||
help="Spatial Reference ID. See https://spatialreference.org for details on specific projections.",
|
||||
)
|
||||
@click.option(
|
||||
"--dimensions",
|
||||
"coord_dimension",
|
||||
type=str,
|
||||
default="XY",
|
||||
help="Coordinate dimensions. Use XYZ for three-dimensional geometries.",
|
||||
)
|
||||
@click.option("--not-null", "not_null", is_flag=True, help="Add a NOT NULL constraint.")
|
||||
@load_extension_option
|
||||
def add_geometry_column(
|
||||
db_path,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue