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

Creating UoW for postgres connection. #7

Closed
dnnedelchev opened this issue Aug 17, 2020 · 3 comments
Closed

Creating UoW for postgres connection. #7

dnnedelchev opened this issue Aug 17, 2020 · 3 comments

Comments

@dnnedelchev
Copy link

Is it possible to create a IDbConnection with npgsql connection so that it can be used with postgres db?

@petrhaus
Copy link
Collaborator

Sorry for the late reply, but I was on holiday.
It should be possible, but it may require some breaking changes.
If you want to contribute and open a pull request it would be very nice, otherwise I will try to look into it in the coming weeks.

@petrhaus
Copy link
Collaborator

petrhaus commented Aug 26, 2020

I've published to nuget a beta version (https://www.nuget.org/packages/Dapper.UnitOfWork/1.7.0-beta) which allows you to pass in a DbProviderFactory, in your case it should be NpgsqlFactory.Instance.

        public UnitOfWorkFactory(string connectionString, DbProviderFactory dbProviderFactory = null)
        {
            _connectionString = connectionString;
            _dbProviderFactory = dbProviderFactory ?? SqlClientFactory.Instance;
        }

Please let me know if it works, so I can finalize version 1.7.0

@petrhaus
Copy link
Collaborator

Hi @dnnedelchev,
your feedback would be highly appreciated...

Thanks.

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