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

Add Support for Postgresql #207

Open
linkdotnet opened this issue Apr 28, 2023 · 2 comments
Open

Add Support for Postgresql #207

linkdotnet opened this issue Apr 28, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@linkdotnet
Copy link
Owner

Add Postgresql support (for example via Entity Framework).

@linkdotnet linkdotnet added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Apr 28, 2023
@diegodrf
Copy link

Hi @linkdotnet, I would like to help you.
I don't have experience acting in open-source projects, but I would like to start.

Could you give me details about the issue? It's just to add the support for Postgresql or did you try before and find incompatibilities?

@linkdotnet
Copy link
Owner Author

Hey @diegodrf - cool, help is always appreciated.

I did not try until now with PostgreSQL, but as the blog isn't using anything exotic, I don't expect much trouble here.

There are multiple ways to solve the issue. The easiest way is to use Entity Framework Provider. There you already have a repository and all the code around. See Infrastructure.

So adding the package will almost do everything for you. You just have to add the new provider in PersistenceProvider and create a new PostgreSQL extension in the RegistrationExtensions namespace.

The more complicated way is not to use Entity Framework and use something else. For this you would have to implement your own IRepository. You could have a look at how the SqlRepository does it at the moment, but that is up to you.

The general workflow looks like this:

  1. In the appsettings.json you can define your storage provider - the string has to be the same as in the PersistenceProvider class
  2. On Startup the blog checks for this and calls the StorageProviderExtensions, which you would add the new PostgreSQL type, and registers all the necessary types.
  3. The components just get injected the IRepository<T> so they don't know what underlying technology is used.

If you need more details let me know. You can also just start, open a PR and ask your questions if this is easier for you

@linkdotnet linkdotnet linked a pull request Jun 24, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants