mix drops.relation.refresh_cache (drops_relation v0.1.0)

View Source

Refreshes the Drops.Relation cache for all tables in specified repositories.

This task clears the existing cache and warms it up again by inferring schemas for all tables in the database. This is useful when database schema changes have been made and you want to ensure the cache is up to date.

Usage

mix drops.relation.refresh_cache [options]

Options

  • --repo - The repository to refresh cache for (can be specified multiple times)
  • --all-repos - Refresh cache for all configured repositories
  • --tables - Comma-separated list of specific tables to refresh (optional)
  • --verbose - Show detailed output during cache refresh

Examples

# Refresh cache for all configured repositories
mix drops.relation.refresh_cache --all-repos

# Refresh cache for a specific repository
mix drops.relation.refresh_cache --repo MyApp.Repo

# Refresh cache for specific tables only
mix drops.relation.refresh_cache --repo MyApp.Repo --tables users,posts,comments

# Verbose output
mix drops.relation.refresh_cache --repo MyApp.Repo --verbose

Notes

  • This task requires the application to be started to access repository configuration
  • If no repositories are specified, it will use all repositories configured in :ecto_repos
  • The cache must be enabled for this task to have any effect
  • Tables that don't exist in the database will be skipped with a warning