1+ content = render_j2_template (api .tpl_config ,
2+ api .config ['server' ]['templates' ],
3+ content = render_j2_template (api .tpl_config ,
4+ api .config ['server' ]['templates' ],
5+ query = {"status" : status }
6+ query = {}
7+ cursor = collection .find (query )
8+ if offset :
9+ cursor = cursor .skip (offset )
10+ if limit :
11+ cursor = cursor .limit (limit )
12+ jobs = list (cursor )
13+ if offset :
14+ results = results .offset (offset )
15+ if limit :
16+ results = results .limit (limit )
17+
18+ # The documented configuration surface is storage_crs (a URI
19+ # such as "http://www.opengis.net/def/crs/EPSG/0/2169").
20+ # options.projection is the legacy integer override kept for
21+ # backward compatibility: when it is present it still wins,
22+ # so existing deployments that rely on it keep working.
23+ except (KeyError , ValueError ):
24+ crs_epsg = self .storage_crs .to_epsg ()
25+ self .crs = crs_epsg if crs_epsg is not None else 4326
26+ from typing import Optional , Any , Union
27+ from sqlalchemy .engine import URL , Engine , make_url
28+ conn_str : Optional [Union [str , URL ]] = None ,
29+ else :
30+ # A caller-provided URL with a bare driver name (e.g. "postgresql://")
31+ # resolves to SQLAlchemy's default DBAPI for that backend (psycopg v3
32+ # for PostgreSQL), which may not be installed. Honour the provider's
33+ # driver_name when the URL does not already pin one.
34+ parsed = make_url (conn_str )
35+ if '+' not in parsed .drivername and '+' in driver_name :
36+ backend = driver_name .split ('+' , 1 )[0 ]
37+ if parsed .drivername == backend :
38+ conn_str = parsed .set (
39+ drivername = driver_name
40+ )
0 commit comments