leantime icon indicating copy to clipboard operation
leantime copied to clipboard

Use Postgresql as the database

Open fire opened this issue 6 years ago • 7 comments

As part of policy, my self-hosted apps use postgresql.

This may be something that is the same for other people.

Wanted to make an issue for it.

fire avatar Mar 06 '20 00:03 fire

Thanks for reaching out. We use the PDO adapter to connect to the Database so technically could support it. I believe the table create syntax is the major difference. All the other queries don't use any language specific syntax as far as I recall. Let me do some additional research this may be quite feasible.

marcelfolaron avatar Mar 06 '20 03:03 marcelfolaron

Any update on whether this is something that will be pursued? We would like to host this project but we only use Postgresql in production.

GranularSystems avatar May 07 '20 09:05 GranularSystems

Hi, sorry for the delay. This is currently not a priority for us. If there is someone from the community who would like to help we'd be happy to walk you through the potential changes that need to be made.

marcelfolaron avatar May 12 '20 18:05 marcelfolaron

Hi @marcelfolaron, since 2020 I've noticed you've been migrating to Laravel that has full PostgreSQL support. If you think because of that adding PostgreSQL support could now be done in a couple of days, I could try to help out.

jeroenhabets avatar Dec 29 '24 20:12 jeroenhabets

Hey, you are right in that we have been moving our core to laravel. We are also using the laravel DB Connection class already which does support postgres. However all of our custom queries still need to be re-written to

Option A: Use the laravel db querybuilder (https://laravel.com/docs/10.x/queries) <- easier and faster Option B: Replace the repositories with doctrine entities <- better long term solution

A lot of the queries are fairly easy to transform. The primary challenges are around date handling, function usage. I believe the query builder will find the equivalent automatically but that has to be double checked.

I have run some trials and it appears that Claude/ChatGPT can actually refactor our repositories to use the db query builder quite well. I just haven't had the time to do it yet. My estimate right now is that it would probably take someone 3-5 days to rewrite all of the repositories.

With that we can support mysql, postgres and sqlite out of the box. MsSQL might need a little bit of extra work.

marcelfolaron avatar Dec 30 '24 23:12 marcelfolaron

Sorry @marcelfolaron, due to other priorities I cannot free myself up for this until further notice. I've even decided for myself to stay on a spreadsheet for the time being.

That said seems like your comment, including Option A/B and the Claud/ChatGPT tip, will likely be of great value to a future potential contributor.

jeroenhabets avatar Jan 21 '25 16:01 jeroenhabets

Please insert this feature …

MySQL (or MariaDB) is not a real Database. This are "DataContainer" … but not real Database … Postgres is the OpenSource Database … (I would make it to the default Database …)

Lord-KalEl avatar Mar 29 '25 16:03 Lord-KalEl