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
Support for MySQL/PostgreSQL #87
Comments
Hi! As it turns out, I'm several months ahead of you :) The problem is that SQL queries are not quite portable, so I would need to be able to detect the engine at runtime, and that required launchbadge/sqlx#1228. It was only recently merged, so as soon as there's a release with it, I can update (potentially non-trivial process) and get to work on multi-DB support. |
LOL, that’s actually hilarious. I wasn’t aware that you were working on it. TYSM and best of luck w/ the implementation! |
Just a quick update on the issue, there's still a blocker on the SQL query builder, but it should be resolved with SeaQL/sea-query#275 |
Before I address this one, I want to do a bit more work on the database schema to hopefully avoid having to migrate schemas for three different DB engines. I'll try to work on #67 before. |
If support for an extermal SQL database will be implemented, does that also mean that then high-availability LLDAP cluster can be created? (shared persistent storage for configuration files and LDAP data in extexternal SQL database) |
Yes, each instance is stateless, so as long as they share the same configuration file/private keys and write to the same DB you can have multiple instances. |
Is there some sort of estimate that how hard is migrate an existing SQLite instance to the PostgreSQL/MariaDB one? I would like to start using LLDAP in my lab-environment, but I'm hesitating do that, because I would like to run my instance on an external database at some point. |
Migrating should be very easy, since I intentionally don't use advanced
features. I haven't tried it, but you should be able to dump SQLite to an
SQL file and load it from the other DB.
…On Tue, 30 Aug 2022, 18:29 Toni Kaislaoja, ***@***.***> wrote:
Is there some sort of estimate that how hard is migrate an existing SQLite
instance to the PostgreSQL/MariaDB one?
I would like to start using LLDAP in my lab-environment, but I'm
hesitating do that, because I would like to run my instance on an external
database at some point.
—
Reply to this email directly, view it on GitHub
<#87 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGCPWN5PONC3N6RNP7BDNTV3XIBJANCNFSM5IWDWVOA>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
okay, thanks 👍 |
Sorry for the long wait! It's now implemented in the latest version :) |
Thank you so much! So will this published to the next container image release? It it should work then with setting |
Yes, it should work. Feel free to try, and tell me if it doesn't! |
Hey! First of all - thank you for this! This will finally introduce HA to LLDAP in my cluster 😍 Tried this today, however I have problems connecting to postgresql :(
My database_url is as follows:
Any hints will be very welcome :) |
Tried both, seems not easy as it said. ☕ On mysql
On postgress
|
Re-opening since it was a very optimistic close :) |
e2e w/ mysql/pg containers should do the trick, though I guess you're probably already planning on that. |
I have attempted to use the |
The entire internals of the server now work using only NaiveDateTime, since we know they are all UTC. At the fringes (LDAP, GraphQL, JWT tokens) we convert back into UTC to make sure we have a clear API. This allows us to be compatible with Postgres (which doesn't support DateTime<UTC>, only NaiveDateTime). This change is backwards compatible since in SQlite with Sea-query/Sea-ORM, the UTC datetimes are stored without a timezone, as simple strings. It's the same format as NaiveDateTime. Fixes #87.
The entire internals of the server now work using only NaiveDateTime, since we know they are all UTC. At the fringes (LDAP, GraphQL, JWT tokens) we convert back into UTC to make sure we have a clear API. This allows us to be compatible with Postgres (which doesn't support DateTime<UTC>, only NaiveDateTime). This change is backwards compatible since in SQlite with Sea-query/Sea-ORM, the UTC datetimes are stored without a timezone, as simple strings. It's the same format as NaiveDateTime. Fixes #87.
To anyone using LLDAP with an external database is the |
You still need a place to put the configuration file, and server key, but these can be read-only. You can run multiple instances connected to the same DB, the server is stateless. |
Thanks for confirming @nitnelave . This release looks very nice. I have opened an issue to discuss some of those points you make here. #502 |
Hi, first of all, thanks for the project!
And I just want to clarify - this isn't an immediate feature request, but rather me asking would this be something you'd be okay putting on the roadmap?
Right now, LLDAP apparently stores everything in
/data
directory. But using SQL databases to back all of LLDAP's data could be so versatile:/data
directory, you can! Just use SQLite as the backing storeAnd I believe most of the SQL queries should be portable as well (with the only exception being DDLs). Thoughts?
The text was updated successfully, but these errors were encountered: