Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NpgsqlDataSource support #355

Open
maksimnarkevichdp opened this issue Apr 16, 2024 · 3 comments
Open

NpgsqlDataSource support #355

maksimnarkevichdp opened this issue Apr 16, 2024 · 3 comments

Comments

@maksimnarkevichdp
Copy link

Good day,

Is there any plans for NpgsqDataSource support? https://www.npgsql.org/doc/release-notes/7.0.html#dbdatasource

I am eager to help if needed.

@azygis
Copy link
Collaborator

azygis commented Apr 16, 2024

Out of the box - yes, it's kinda planned in my mind, but can't really do it quickly without quite some overhaul of how dependencies (namely Npgsql) are handled.

I think you should be able to do it yourself by using the bootstrapper overload that accepts IConnectionFactory. You can implement the factory any way you want, including supplying the connection from your data source. One way was discussed in #342.

@maksimnarkevichdp
Copy link
Author

Out of the box - yes, it's kinda planned in my mind, but can't really do it quickly without quite some overhaul of how dependencies (namely Npgsql) are handled.

I think you should be able to do it yourself by using the bootstrapper overload that accepts IConnectionFactory. You can implement the factory any way you want, including supplying the connection from your data source. One way was discussed in #342.

Thanks for the quick answer!

Can't find any info regarding what is the lifetime of IConnecitonFactory dependency?

@azygis
Copy link
Collaborator

azygis commented Apr 16, 2024

It's not really a dependency per se, it is not resolved from the dependency container. By default it just uses a NpgsqlConnectionFactory instance which is instantiated manually internally.

You should treat it as a singleton (similar to how DbDataSource typically should be).

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

No branches or pull requests

2 participants