Skip to main content

sync_with_secrets

Function sync_with_secrets 

Source
pub fn sync_with_secrets(
    out: &Path,
    config: &Config,
    schemas: Option<&[String]>,
    database_url: &DatabaseUrl,
    cache_key: Option<&CacheKey>,
) -> Result<(), Error>
Expand description

Synchronize PostgreSQL metadata using caller-owned secret material.

This is the embedded equivalent of sync. It never reads DATABASE_URL or SAFE_MIGRATE_CACHE_KEY from the process environment. Pass a cache key exactly when cache_encryption is enabled in config.

ยงErrors

Returns ErrorKind::Configuration for invalid settings or an inconsistent cache-key choice, and ErrorKind::Sync for connection, catalog, or cache replacement failures.