db icon indicating copy to clipboard operation
db copied to clipboard

Support for PostgreSQL

Open csaf4370 opened this issue 5 years ago • 10 comments

Hi!

I really like this project and the idea of it! Great work. My goto db is PostgreSQL, are there any plans to support it?

csaf4370 avatar Dec 11 '19 10:12 csaf4370

Well the plans are there but the time is not (as in: I don't have any time). I also don't have a direct need myself, which probably means that we will need to rely on outside contributions to add support for other databases.

However, implementing a basic version of it should be possible without too much effort, because I wrote the software with extensibility in mind.

Basically the actual database operations are contained in two different sets of tiny files, and during setup ("db init") you already have to choose the database type so that the software knows where to find these files.

I would love to see PostgreSQL support. You could get started by copying the mysql folder in the bin/drivers into a new postgresql folder, and then changing the four scripts ('load', 'save', ...) in the postgresql\connectors\direct folder until they can make a backup, restore a backup, test the database connection, and run a direct SQL query. I think that's the meat of what needs to happen to add PostgreSQL support.

infostreams avatar Dec 11 '19 10:12 infostreams

Thanks for the detailed reply,

I started with the postgresql support, but I'm not done yet. Hopefully the next few weeks, will allow me to finish it.

Cheers

csaf4370 avatar Dec 23 '19 12:12 csaf4370

Awesome!

infostreams avatar Dec 23 '19 12:12 infostreams

Hey @csaf4370! I'm interested in this too. How much work is involved? Can I be of help?

harrybiddle avatar Jan 08 '20 15:01 harrybiddle

@csaf4370 Any chance you can share what you have so far? However buggy or incomplete?

infostreams avatar Jan 09 '20 19:01 infostreams

sorry for the late reply, I already got a few things working. When I'm at home I'll publish my fork and the current status.

edit: here we go:

my fork lives in https://github.com/csaf4370/db.git branch: postgresql

make sure that the current repository is already postgresql or a new one. Currently you can not mix mysql and postgresql in the same repository.

currently working:

  • [x] db init with postgresql and direct connector
  • [x] connection test for the init part
  • [x] db save
  • [x] db export

whats certainly currently missing:

  • [ ] db load
  • [ ] db import
  • [ ] db server add (somehow works, but not fully)

All the best.

csaf4370 avatar Jan 10 '20 09:01 csaf4370

see above comment... not sure if you get a notification for the edit.

csaf4370 avatar Jan 10 '20 17:01 csaf4370

Sorry, I've been sick all week. I'll have a look at this early next week - thanks for sharing!

infostreams avatar Jan 16 '20 07:01 infostreams

You guys are awesome! I'm really looking forward to it. :)

paulgeisler avatar Jan 16 '20 08:01 paulgeisler

Maybe this repo could help somehow: https://github.com/postgrespro/pg_probackup

paulgeisler avatar Jan 28 '20 14:01 paulgeisler