Add support for custom database adapters and update documentation#157
Add support for custom database adapters and update documentation#157snowfrogdev wants to merge 4 commits intojbogard:mainfrom
Conversation
snowfrogdev
commented
May 16, 2025
- Introduced a new method in Respawner to create an instance using a custom IDbAdapter.
- Added a CustomSqliteAdapter implementation with tests to demonstrate functionality.
- Updated README.md to include instructions for using custom database adapters.
- Introduced a new method in Respawner to create an instance using a custom IDbAdapter. - Added a CustomSqliteAdapter implementation with tests to demonstrate functionality. - Updated README.md to include instructions for using custom database adapters.
The The new The README already mentions how it can be used. var respawner = await Respawner.CreateAsync(connection, new RespawnerOptions
{
SchemasToInclude = new []
{
"public"
},
DbAdapter = DbAdapter.Postgres // 👈 optional, inferred from the connection for SQL Server, PostgreSQL, MySQL, Oracle and Informix
}); |
…o use a custom implementation of IDbAdapter
Wow, how did I miss that? All I remember is that I was trying to implement a SQLite Adapter and was running into issues trying to use with Respawn and it had to do with the DbAdapter not being picked up properly. I must have messed something up. So, given that, I totally agree with you, we should just keep the existing implementation. But...
To be fair, the docs could be a bit clearer on how to use a custom IDbAdapter. The docs just show that you can explicitly say which one of the built-in DbAdapters you want to use. I've updated the PR to document how to use IDbAdapter a little better. |