22 lines
486 B
Python
22 lines
486 B
Python
POSTGIS = {
|
|
"host": "192.168.60.24",
|
|
"port": "5432",
|
|
"db": "test_postgis",
|
|
"user": "postgres",
|
|
"password": "12345"
|
|
}
|
|
|
|
def build_uri(table_name: str) -> str:
|
|
return (
|
|
f"dbname='{POSTGIS['db']}' "
|
|
f"host='{POSTGIS['host']}' "
|
|
f"port='{POSTGIS['port']}' "
|
|
f"user='{POSTGIS['user']}' "
|
|
f"password='{POSTGIS['password']}' "
|
|
f"sslmode=disable "
|
|
f"table=\"public\".\"{table_name}\" "
|
|
f"key='_id'"
|
|
)
|
|
|
|
|