Skip to content

implement FromEnv for SqlConnector and bump patch version#137

Merged
Fraser999 merged 1 commit intomainfrom
fraser/from-env-sql-connector
Apr 16, 2026
Merged

implement FromEnv for SqlConnector and bump patch version#137
Fraser999 merged 1 commit intomainfrom
fraser/from-env-sql-connector

Conversation

@Fraser999
Copy link
Copy Markdown
Contributor

@Fraser999 Fraser999 commented Apr 16, 2026

Summary

  • Add a FromEnv implementation for signet_cold_sql::SqlConnector, gated behind a new cold-sql feature flag.
  • Reads SIGNET_COLD_SQL_URL (required) plus optional pool-tuning vars (MAX_CONNECTIONS, MIN_CONNECTIONS, ACQUIRE_TIMEOUT_SECS, MAX_LIFETIME_SECS, IDLE_TIMEOUT_SECS) with sensible defaults.
  • Bump patch version to 0.19.1 (additive, semver-compatible).

Environment variables

Variable Required Default Description
SIGNET_COLD_SQL_URL yes - SQL connection URL (postgres:// or sqlite:)
SIGNET_COLD_SQL_MAX_CONNECTIONS no 100 Max pool connections
SIGNET_COLD_SQL_MIN_CONNECTIONS no 5 Min idle pool connections
SIGNET_COLD_SQL_ACQUIRE_TIMEOUT_SECS no 5 Pool acquire timeout
SIGNET_COLD_SQL_MAX_LIFETIME_SECS no 1800 Max connection lifetime
SIGNET_COLD_SQL_IDLE_TIMEOUT_SECS no 600 Idle connection timeout

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Copy Markdown
Member

@prestwich prestwich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Fraser999 Fraser999 merged commit 3dae350 into main Apr 16, 2026
8 checks passed
@Fraser999 Fraser999 deleted the fraser/from-env-sql-connector branch April 16, 2026 15:26
Comment thread src/utils/from_env.rs
.with_min_connections(min_conns)
.with_acquire_timeout(std::time::Duration::from_secs(acquire_timeout))
.with_idle_timeout(Some(std::time::Duration::from_secs(idle_timeout)))
.with_max_lifetime(Some(std::time::Duration::from_secs(max_lifetime))))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit is that i think the durstion constructor is const and the constants could be durations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants