Skip to content

Commit 3499daa

Browse files
authored
Working v0.4.5 (#91)
* fixes for v0.4.5
1 parent 3c2af06 commit 3499daa

14 files changed

+2920
-49
lines changed

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
# Changelog
2+
## [v0.4.5]
3+
4+
### Fixed
5+
- Fixes support for using the intersects parameter at the base of a search (regression from changes in 0.4.4)
6+
- Fixes issue where results for a search on id returned [None] rather than [] (regression from changes in 0.4.4)
7+
8+
9+
### Changed
10+
- Changes requirement for PostgreSQL to 13+, the triggers used to main partitions are not available to be used on partitions prior to 13 ([#90](https://github.com/stac-utils/pgstac/pull/90))
11+
- Bump requirement for asyncpg to 0.25.0 ([#82](https://github.com/stac-utils/pgstac/pull/82))
12+
13+
### Added
14+
- Added more tests.
15+
216
## [v0.4.4]
317

418
### Added

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ PGDatabase Schema and Functions for Storing and Accessing STAC collections and i
2020

2121
STAC Client that uses PGStac available in [STAC-FastAPI](https://github.com/stac-utils/stac-fastapi)
2222

23-
PGStac requires **Postgresql>=12** and **PostGIS>=3**. Best performance will be had using PostgreSQL>=13 and PostGIS>=3.1.
23+
PGStac requires **Postgresql>=13** and **PostGIS>=3**. Best performance will be had using PostGIS>=3.1.
2424

2525
### PGStac Settings
2626
PGStac installs everything into the pgstac schema in the database. You will need to make sure that this schema is set up in the search_path for the database.
2727

28-
There are additional variables that control the settings used for calculating and displaying context (total row count) for a search, as well as a variable to set the filter language (cql-json or cql-json2).
28+
There are additional variables that control the settings used for calculating and displaying context (total row count) for a search, as well as a variable to set the filter language (cql-json or cql-json2).
2929
The context is "off" by default, and the default filter language is set to "cql2-json".
3030

3131
Variables can be set either by passing them in via the connection options using your connection library, setting them in the pgstac_settings table or by setting them on the Role that is used to log in to the database.
3232

3333
Example for updating the pgstac_settings table with a new value:
3434
```sql
35-
INSERT INTO pgstac_settings (name, value)
36-
VALUES
35+
INSERT INTO pgstac_settings (name, value)
36+
VALUES
3737
('default-filter-lang', 'cql-json'),
3838
('context', 'on')
39-
39+
4040
ON CONFLICT ON CONSTRAINT pgstac_settings_pkey DO UPDATE SET value = excluded.value;
4141
```
4242

pypgstac/poetry.lock

+32-35
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pypgstac/pypgstac/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""PyPGStac Version."""
2-
__version__ = "0.4.4"
2+
__version__ = "0.4.5"

pypgstac/pypgstac/migrate.py

+15
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,19 @@ async def get_version(conn: asyncpg.Connection) -> str:
121121
return version
122122

123123

124+
async def check_pg_version(conn: asyncpg.Connection) -> str:
125+
"""Get the current pg version number from a pgstac database."""
126+
async with conn.transaction():
127+
version = await conn.fetchval(
128+
"""
129+
SHOW server_version;
130+
"""
131+
)
132+
if int(version.split(".")[0]) < 13:
133+
raise Exception("PGStac requires PostgreSQL 13+")
134+
return version
135+
136+
124137
async def get_version_dsn(dsn: Optional[str] = None) -> str:
125138
"""Get current version from a specified database."""
126139
conn = await asyncpg.connect(dsn=dsn)
@@ -138,6 +151,8 @@ async def run_migration(
138151
files = []
139152

140153
conn = await asyncpg.connect(dsn=dsn)
154+
pgversion = await check_pg_version(conn)
155+
typer.echo(f"Migrating PGStac on PostgreSQL Version {pgversion}")
141156
oldversion = await get_version(conn)
142157
try:
143158
if oldversion == toversion:

0 commit comments

Comments
 (0)