Skip to content

refactor: remove global database state and introduce Micrate::Runner#94

Open
renich wants to merge 2 commits into
amberframework:masterfrom
renich:feature/remove-globals
Open

refactor: remove global database state and introduce Micrate::Runner#94
renich wants to merge 2 commits into
amberframework:masterfrom
renich:feature/remove-globals

Conversation

@renich

@renich renich commented Jun 11, 2026

Copy link
Copy Markdown

Description

Phase 1 (Stabilization) of the ENHANCEMENT_ROADMAP.md.

Replaced Micrate::DB and its global @@connection_url and @@dialect with Micrate::Runner context objects. This encapsulates connection configuration and allows for concurrent programmatic database operations, making Micrate easier to use via Crystal's API without clashing singletons.

  • Moved all execution methods out of the global module into Micrate::Runner
  • Updated Micrate::Cli to instantiate runner
  • Updated example files and README instructions to demonstrate programmatic Runner usage.

All existing unit specs have been retained and verified to pass.

Signed-off-by: Rénich Bon Ćirić renich@woralelandia.com
Co-developed-by: Gemini AI renich+gemini@woralelandia.com

renich added 2 commits June 11, 2026 00:58
- Add and run ameba for linting.
- Resolve not_nil! and syntax/style issues reported by ameba.
- Ignore pedantic .ameba.yml rules like BlockParameterName.
- Rename set_database_to_schema to extract_schema_name for accuracy.

Co-developed-by: Gemini AI <renich+gemini@woralelandia.com>
Signed-off-by: Rénich Bon Ćirić <renich@woralelandia.com>
Replaced `Micrate::DB` and its global `@@connection_url` and `@@dialect` with
`Micrate::Runner` context objects. This encapsulates connection configuration
and allows for concurrent programmatic database operations.

Signed-off-by: Rénich Bon Ćirić <renich@woralelandia.com>
Co-developed-by: Gemini AI <renich+gemini@woralelandia.com>
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.

1 participant