user_backend_sql_raw
user_backend_sql_raw copied to clipboard
Added support for unix_socket connections
- updated postgresql and mariadb adapters so that they will test for supplied socket first, then fall back to standard host:port
- included config test and updated multivalue tests
Addresses #27
Thank you Oucil. I only now had the time to work on this. Evaluating this now.
@PanCakeConnaisseur Been a long time, my apologies, I changed professions and haven't had a lot of time till now, thanks @Tachi107 for reminding me of this PR :) I'll try to make the suggested updates and do some testing and resubmit. Cheers!
Thanks for the renewed interest in this feature! If you'd like, I could apply this patch to my server as soon as you'll submit your changes, to give you an extra beta-tester :)
I recently switched operating systems and the way services communicate does not involve chroots. Therefore, I looked into socket communication and it is, as you suggested, faster and easier. Easier because there is not need for passwords because services are identified by the system user that they run under.
I was about to check this PR again and implement socket support. During research I realized that socket communication works for PostgreSQL out-of-the-box. You can simply set db_host (which becomes host in the DSN) to the path of the socket and it just works - as many things in PostgreSQL as opposed to MySQL.
I am not sure if its worth the effort to implement this just for MySQL. Its the time needed to do this cleanly (there was no further commits in this PR) and would also complicate the configuration.
I'll leave this open for a while to give people the opportunity to express how much they need this in MySQL. I am leaning towards not putting any effort into MySQL.
Glad you see the benefit of the socket connections, though it's disappointing to see the reason you plan to forego support for other systems is because your PostgresSQL works out of the box.
This shouldn't be a MySQL vs PostgresSQL debate, there are pros and cons to each and other peoples choices are valid. If you want it to be about that though, Nextcloud recommends MySQL/MariaDB as their preferred choice, but also support Oracle 11g, and PostgreSQL. It doesn't make any sense that you would forego support for the recommended solution and DB behind most Nextcloud installations.
If this is a personal project that you're just sharing for fun, then thank you for doing that, the code base is good and we appreciate it! But if this is meant to grow, saying no to three other systems because yours works without any work is a bit short sighted.
Like I said, I do appreciate your work. Thanks.
@oucil,I started another (private) branch in the meantime to unify the db configuration using DSNs, which would also enable the use of much more DBs and keep support for MySQL. Its in progress, so please don't work on this PR anymore. Release will be soonish, in 1-21 days.
Regarding PostgreSQL vs MySQL: Nextcloud recommends MySQL but there is no reason given. A few years ago I asked in the official discourse forum and no answer was provided. I can only assume that this sentence hasn't been changed in the documentation for 10 years and nobody cared to do so. In my job experience PostgreSQL dominates, too. With my experience using MySQL I can totally understand why. But again, I don't claim to an expert on the subject.
@PanCakeConnaisseur That's great to hear, and like I said, I really do appreciate your work on this. Sounds like a great solution!