Skip to content

Commit 3c5cb71

Browse files
config: Add SYNC_URL, SYNC_TOKEN, and SYNC_PUSH_THRESHOLD env var constants
These `pub(crate)` constants follow the established pattern from observability env keys (LOG_LEVEL_ENV_KEY, etc.) and are the configuration seam for dual-mode TursoDb initialization. Co-authored-by: SCE <sce@crocoder.dev>
1 parent d5567bc commit 3c5cb71

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

cli/src/services/config/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ pub(crate) const ENV_LOG_FORMAT: &str = "SCE_LOG_FORMAT";
4040
pub(crate) const ENV_LOG_FILE: &str = "SCE_LOG_FILE";
4141
pub(crate) const ENV_LOG_FILE_MODE: &str = "SCE_LOG_FILE_MODE";
4242
pub(crate) const ENV_ATTRIBUTION_HOOKS_ENABLED: &str = "SCE_ATTRIBUTION_HOOKS_ENABLED";
43+
44+
// Sync (Turso Cloud) env var keys.
45+
// When SCE_SYNC_URL and SCE_SYNC_TOKEN are both set, TursoDb<M> opens in sync
46+
// (remote-backed) mode. When either is absent, local-only mode is used.
47+
// SCE_SYNC_PUSH_THRESHOLD controls how many writes accumulate before an
48+
// automatic push (defaults to 10 when unset).
49+
#[allow(dead_code)]
50+
pub(crate) const SYNC_URL_ENV_KEY: &str = "SCE_SYNC_URL";
51+
#[allow(dead_code)]
52+
pub(crate) const SYNC_TOKEN_ENV_KEY: &str = "SCE_SYNC_TOKEN";
53+
#[allow(dead_code)]
54+
pub(crate) const SYNC_PUSH_THRESHOLD_ENV_KEY: &str = "SCE_SYNC_PUSH_THRESHOLD";
55+
4356
const WORKOS_CLIENT_ID_ENV: &str = "WORKOS_CLIENT_ID";
4457
const WORKOS_CLIENT_ID_BAKED_DEFAULT: &str = "client_sce_default";
4558
const WORKOS_CLIENT_ID_KEY: AuthConfigKeySpec = AuthConfigKeySpec {

context/plans/turso-sync-adapter.md

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)