You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGES.md
+42-1Lines changed: 42 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,53 @@
4
4
5
5
### Changed
6
6
7
+
- rename `POSTGRES_HOST_READER` to `PGHOST` in config **breaking change**
8
+
- rename `POSTGRES_USER` to `PGUSER` in config **breaking change**
9
+
- rename `POSTGRES_PASS` to `PGPASSWORD` in config **breaking change**
10
+
- rename `POSTGRES_PORT` to `PGPORT` in config **breaking change**
11
+
- rename `POSTGRES_DBNAME` to `PGDATABASE` in config **breaking change**
12
+
```python
13
+
from stac_fastapi.pgstac.config import PostgresSettings
14
+
15
+
# before
16
+
settings = PostgresSettings(
17
+
postgres_user="user",
18
+
postgres_pass="password",
19
+
postgres_host_reader="0.0.0.0",
20
+
postgres_host_writer="0.0.0.0",
21
+
postgres_port=1111,
22
+
postgres_dbname="pgstac",
23
+
)
24
+
25
+
# now
26
+
settings = PostgresSettings(
27
+
pguser="user",
28
+
pgpassword="password",
29
+
pghost="0.0.0.0",
30
+
pgport=1111,
31
+
pgdatabase="pgstac",
32
+
)
33
+
```
34
+
35
+
- rename `reader_connection_string` to `connection_string` in `PostgresSettings` class **breaking change**
7
36
- add `ENABLE_TRANSACTIONS_EXTENSIONS` env variable to enable `transaction` extensions
8
37
- disable transaction and bulk_transactions extensions by default **breaking change**
9
38
- update `stac-fastapi-*` version requirements to `>=5.2,<6.0`
10
39
- add pgstac health-check in `/_mgmt/health`
11
40
- switch from using pygeofilter to cql2
12
41
42
+
### Added
43
+
44
+
- add `write_connection_pool` option in `stac_fastapi.pgstac.db.connect_to_db` function
45
+
- add `write_postgres_settings` option in `stac_fastapi.pgstac.db.connect_to_db` function to set specific settings for the `writer` DB connection pool
46
+
47
+
### removed
48
+
49
+
-`stac_fastapi.pgstac.db.DB` class
50
+
-`POSTGRES_HOST_WRITER` in config
51
+
-`writer_connection_string` in `PostgresSettings` class
52
+
-`testing_connection_string` in `PostgresSettings` class
53
+
13
54
## [5.0.2] - 2025-04-07
14
55
15
56
### Fixed
@@ -183,7 +224,7 @@ As a part of this release, this repository was extracted from the main
183
224
### Added
184
225
185
226
- Nginx service as second docker-compose stack to demonstrate proxy ([#503](https://github.com/stac-utils/stac-fastapi/pull/503))
186
-
- Validation checks in CI using [stac-api-validator](github.com/stac-utils/stac-api-validator) ([#508](https://github.com/stac-utils/stac-fastapi/pull/508))
227
+
- Validation checks in CI using [stac-api-validator](https://github.com/stac-utils/stac-api-validator) ([#508](https://github.com/stac-utils/stac-fastapi/pull/508))
187
228
- Required links to the sqlalchemy ItemCollection endpoint ([#508](https://github.com/stac-utils/stac-fastapi/pull/508))
188
229
- Publication of docker images to GHCR ([#525](https://github.com/stac-utils/stac-fastapi/pull/525))
The default `stac-fastapi-pgstac` application comes will **all** extensions enabled (except transaction). Users can use `ENABLED_EXTENSIONS` environment variable to limit the supported extensions.
6
+
7
+
Available values for `ENABLED_EXTENSIONS`:
8
+
9
+
-`query`
10
+
-`sort`
11
+
-`fields`
12
+
-`filter`
13
+
-`free_text` (only for collection-search)
14
+
-`pagination`
15
+
-`collection_search`
16
+
17
+
Example: `ENABLED_EXTENSIONS="pagination,sort"`
18
+
19
+
20
+
Since `6.0.0`, the transaction extension is not enabled by default. To add the transaction endpoints, users can set `ENABLE_TRANSACTIONS_EXTENSIONS=TRUE/YES/1`.
21
+
22
+
### Database config
23
+
24
+
-`PGUSER`: postgres username
25
+
-`PGPASSWORD`: postgres password
26
+
-`PGHOST`: hostname for the connection
27
+
-`PGPORT`: database port
28
+
-`PGDATABASE`: database name
29
+
-`DB_MIN_CONN_SIZE`: Number of connection the pool will be initialized with. Defaults to `1`
30
+
-`DB_MAX_CONN_SIZE` Max number of connections in the pool. Defaults to `10`
31
+
-`DB_MAX_QUERIES`: Number of queries after a connection is closed and replaced with a new connection. Defaults to `50000`
32
+
-`DB_MAX_INACTIVE_CONN_LIFETIME`: Number of seconds after which inactive connections in the pool will be closed. Defaults to `300`
33
+
-`SEARCH_PATH`: Postgres search path. Defaults to `"pgstac,public"`
34
+
-`APPLICATION_NAME`: PgSTAC Application name. Defaults to `"pgstac"`
35
+
36
+
##### Deprecated
37
+
38
+
In version `6.0.0` we've renamed the PG configuration variable to match the official naming convention:
39
+
40
+
-`POSTGRES_USER` -> `PGUSER`
41
+
-`POSTGRES_PASS` -> `PGPASSWORD`
42
+
-`POSTGRES_HOST_READER` -> `PGHOST`
43
+
-`POSTGRES_HOST_WRITER` -> `PGHOST`*
44
+
-`POSTGRES_PORT` -> `PGPORT`
45
+
-`POSTGRES_DBNAME` -> `PGDATABASE`
46
+
47
+
\* Since version `6.0`, users cannot set a different host for `writer` and `reader` database but will need to customize the application and pass a specific `stac_fastapi.pgstac.config.PostgresSettings` instance to the `connect_to_db` function.
48
+
49
+
### Validation/Serialization
50
+
51
+
-`ENABLE_RESPONSE_MODELS`: use pydantic models to validate endpoint responses. Defaults to `False`
52
+
-`ENABLE_DIRECT_RESPONSE`: by-pass the default FastAPI serialization by wrapping the endpoint responses into `starlette.Response` classes. Defaults to `False`
53
+
54
+
### Misc
55
+
56
+
-`STAC_FASTAPI_VERSION` (string) is the version number of your API instance (this is not the STAC version)
57
+
-`STAC FASTAPI_TITLE` (string) should be a self-explanatory title for your API
58
+
-`STAC FASTAPI_DESCRIPTION` (string) should be a good description for your API. It can contain CommonMark
59
+
-`STAC_FASTAPI_LANDING_ID` (string) is a unique identifier for your Landing page
60
+
-`ROOT_PATH`: set application root-path (when using proxy)
61
+
-`CORS_ORIGINS`: A list of origins that should be permitted to make cross-origin requests. Defaults to `*`
62
+
-`CORS_METHODS`: A list of HTTP methods that should be allowed for cross-origin requests. Defaults to `"GET,POST,OPTIONS"`
63
+
-`USE_API_HYDRATE`: perform hydration of stac items within stac-fastapi
64
+
-`INVALID_ID_CHARS`: list of characters that are not allowed in item or collection ids (used in Transaction endpoints)
0 commit comments