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 PostgreSQL backend #1194

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

leso-kn
Copy link

@leso-kn leso-kn commented Jul 17, 2023

This PR adds experimental PostgreSQL support.

Based upon the work of @dxtr, extended and adapted to the latest version of Baikal.

The following features were tested:

  • Baikal setup procedure / UI (with Postgres)
  • Creating / deleting / editing a user
  • Creating / deleting / editing a calendar
  • Listing contacts
  • Logging in / creating / deleting an event through the webui (User login)
  • Subscribing to a calendar / adding / deleting an event through a DAV client
    • Thunderbird
    • DAVx⁵ for Android

Co-authored-by: Kim Lidström <dxtr@users.noreply.github.com>
@leso-kn leso-kn changed the title Add Pgsql backend (#122) Add Pgsql backend Jul 17, 2023
@leso-kn
Copy link
Author

leso-kn commented Jul 17, 2023

ref #122

@leso-kn leso-kn changed the title Add Pgsql backend Add PostgreSQL backend Jul 17, 2023
@2Belette
Copy link

since one ! does this PR would make it into new release ?

@comrada
Copy link

comrada commented Sep 21, 2023

Looking forward to Postgresql support!! I keep MySQL on the server just for the sake of Baikal.

@ndruba
Copy link

ndruba commented Dec 31, 2023

I use Baikal with this patch for my personal use during half year from clean install and don't have any troubles.

The following features were tested:

Baikal setup procedure / UI (with Postgres)
Creating a user
Creating / editing a calendar (with Todos and Tasks)
Creating / editing Address Book
Logging in, listing an event and contacts through the webui (dav.php)
Subscribing to a calendar and address book / adding / deleting an event and contacts through a DAV client
Thunderbird
Carddav-sync/Caldav-sync

Copy link

@Terrance Terrance left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just had a go at setting this up locally (I have a lot of calendars so SQLite is probably not a great choice, and I'm not interested in setting up MySQL just for this when I already have other software talking to PostgreSQL) and it seems to work, but with a couple of snags during the initial setup.

# Asserting PDO::SQLite or PDO::MySQL
$aPDODrivers = \PDO::getAvailableDrivers();
if (!in_array('sqlite', $aPDODrivers, true) && !in_array('mysql', $aPDODrivers, true)) {
exit('<strong>Baikal Fatal Error</strong>: Both <strong>PDO::sqlite</strong> and <strong>PDO::mysql</strong> are unavailable. One of them at least is required by Baikal.');
}

This check needs updating to also include PDO::pgsql as a valid option.

Core/Frameworks/Flake/Framework.php Outdated Show resolved Hide resolved
@leso-kn leso-kn force-pushed the feature/pgsql branch 2 times, most recently from a43af02 to be51975 Compare January 5, 2024 20:57
Copy link

@Terrance Terrance left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more hiccup with the settings page (/admin/?/settings/database/):

if (intval($oForm->modelInstance()->get("mysql")) === 1) {

These will need similar updates to the installation's database page to check for PostgreSQL too (currently the page falls through to SQLite).

@leso-kn leso-kn force-pushed the feature/pgsql branch 2 times, most recently from bed2fc8 to 54ebfe0 Compare February 17, 2024 13:52
@leso-kn
Copy link
Author

leso-kn commented Feb 17, 2024

@Terrance Done! Sorry for the late reply, the updates described in your previous comment are now included in 54ebfe0

@toby63 toby63 mentioned this pull request Mar 1, 2024
@dewey
Copy link

dewey commented Apr 29, 2024

Great to see this, any idea what would be needed to get this merged?

@leso-kn leso-kn requested a review from Terrance June 7, 2024 11:26
Copy link

@Terrance Terrance left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not seen any other issues. 👍

@Ornias1993
Copy link

Combined with CloudNative-PG this finally gives an easy route to enterprise-grade hosted baikal, nice!

@nileshtrivedi
Copy link

Looking forward to this being merged that would finally fix #122

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

Successfully merging this pull request may close these issues.

None yet

8 participants