Return a copy of ``settings`` with the Pathway Live Data Framework-managed defaults (``application_name`` and TCP-keepalive tuning) injected for any key the user did not provide. The user's explicit values always win — :py:meth:`dict.setdefault` is the explicit Python idiom for "set
(settings: dict, unique_name: str | None)
| 129 | |
| 130 | |
| 131 | def _augment_postgres_settings(settings: dict, unique_name: str | None) -> dict: |
| 132 | """Return a copy of ``settings`` with the Pathway Live Data Framework-managed defaults |
| 133 | (``application_name`` and TCP-keepalive tuning) injected for any |
| 134 | key the user did not provide. The user's explicit values always |
| 135 | win — :py:meth:`dict.setdefault` is the explicit Python idiom for |
| 136 | "set if absent" and is what we rely on here. |
| 137 | """ |
| 138 | augmented = dict(settings) |
| 139 | augmented.setdefault("application_name", _build_application_name(unique_name)) |
| 140 | for key, value in _LIBPQ_TIMEOUT_DEFAULTS.items(): |
| 141 | augmented.setdefault(key, value) |
| 142 | return augmented |
| 143 | |
| 144 | |
| 145 | def _connection_string_from_settings(settings: dict): |