Skip to content

Comments

Add adapter_factory_class config option for custom adapters#1

Merged
mbolli merged 5 commits intoconfigurable-adapter-factoryfrom
copilot/add-config-support-for-adapter
Jan 11, 2026
Merged

Add adapter_factory_class config option for custom adapters#1
mbolli merged 5 commits intoconfigurable-adapter-factoryfrom
copilot/add-config-support-for-adapter

Conversation

Copy link

Copilot AI commented Jan 11, 2026

Adds support for overriding the adapter factory via configuration, enabling custom database adapters.

Changes

  • New AdapterFactoryInterface - Contract that custom adapter factories must implement
  • AdapterFactory - Now implements AdapterFactoryInterface
  • Config - Added adapter_factory_class option (defaults to AdapterFactory::class) with validation
  • AbstractCommand / DiffCommand - Use configured adapter factory instead of hardcoded class
  • composer.json - Allow symfony/console ^7.4 || ^8.0

Usage

return [
    'migration_dirs' => [...],
    'environments' => [...],
    'adapter_factory_class' => MyCustomAdapterFactory::class,
];

Custom factories must implement Phoenix\Database\Adapter\AdapterFactoryInterface:

interface AdapterFactoryInterface
{
    public static function instance(EnvironmentConfig $config): AdapterInterface;
}
Original prompt

Add support to the config (that has log_table_name, migration_dirs, etc.) to override the adapter_factory_class. this way it would be possible to add custom adapters


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 11, 2026 19:30
Co-authored-by: mbolli <722725+mbolli@users.noreply.github.com>
Co-authored-by: mbolli <722725+mbolli@users.noreply.github.com>
Co-authored-by: mbolli <722725+mbolli@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support to override adapter factory class in config Add adapter_factory_class config option for custom adapters Jan 11, 2026
Copilot AI requested a review from mbolli January 11, 2026 19:36
@mbolli
Copy link
Owner

mbolli commented Jan 11, 2026

@copilot great. allow symfony/console ^7.4 || ^8.0 in composer.json

Co-authored-by: mbolli <722725+mbolli@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 11, 2026

@copilot great. allow symfony/console ^7.4 || ^8.0 in composer.json

Done in 0effd48. Updated symfony/console to ^7.4 || ^8.0.

@mbolli mbolli changed the base branch from master to configurable-adapter-factory January 11, 2026 19:44
@mbolli mbolli marked this pull request as ready for review January 11, 2026 19:45
@mbolli mbolli merged commit 9257dc7 into configurable-adapter-factory Jan 11, 2026
@mbolli mbolli deleted the copilot/add-config-support-for-adapter branch January 11, 2026 19:45
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