mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-27 12:24:11 +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
|
sqlite-utils create-database trees.db
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
--enable-wal Enable WAL mode on the created database
|
--enable-wal Enable WAL mode on the created database
|
||||||
-h, --help Show this message and exit.
|
--init-spatialite Enable SpatiaLite on the created database
|
||||||
|
--load-extension TEXT SQLite extensions to load
|
||||||
|
-h, --help Show this message and exit.
|
||||||
|
|
||||||
|
|
||||||
create-table
|
create-table
|
||||||
|
|
@ -1226,4 +1228,49 @@ See :ref:`cli_drop_view`.
|
||||||
-h, --help Show this message and exit.
|
-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]]]
|
.. [[[end]]]
|
||||||
|
|
|
||||||
|
|
@ -2746,10 +2746,24 @@ To load it from a specific path, use --load-extension.""",
|
||||||
case_sensitive=False,
|
case_sensitive=False,
|
||||||
),
|
),
|
||||||
default="GEOMETRY",
|
default="GEOMETRY",
|
||||||
|
help="Specify a geometry type for this column.",
|
||||||
|
show_default=True,
|
||||||
)
|
)
|
||||||
@click.option("--srid", type=int, default=4326)
|
@click.option(
|
||||||
@click.option("--dimensions", "coord_dimension", type=str, default="XY")
|
"--srid",
|
||||||
@click.option("--not-null", "not_null", is_flag=True)
|
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
|
@load_extension_option
|
||||||
def add_geometry_column(
|
def add_geometry_column(
|
||||||
db_path,
|
db_path,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue