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

Postgress code supplied, PR? #2874

Open
iWantToKeepAnon opened this issue Mar 16, 2021 · 4 comments · May be fixed by #2875
Open

Postgress code supplied, PR? #2874

iWantToKeepAnon opened this issue Mar 16, 2021 · 4 comments · May be fixed by #2875
Labels
enhancement New feature or request

Comments

@iWantToKeepAnon
Copy link

A couple/few years ago I forked YOURLS and converted it to postgress (but in right inline breaking mysql functionality). I was too green in php then to think it was good code (still am :p) and that I could merge it. I just pulled in an updated YOURLS codebase and applied my changes in a modular fashion. If you want, I can file a PR; look it over here:

I pulled as much database specific code as I found into "includes/class-<mysql|pgsql>.php". I removed the mysql specific backtick syntax everywhere I could (mysql will work w/o it and psql won't work with it). I hacked "docker-entrypoint.sh" over on the docker project:

There needs to be a good database selector mechanism, for now I run:

  • cd users && ln -s ../includes/class-pgsql.php ./db.php
    and that selects postgress.

Let me know what you think.

@iWantToKeepAnon iWantToKeepAnon added the enhancement New feature or request label Mar 16, 2021
@dgw
Copy link
Member

dgw commented Mar 16, 2021

I know we've been talking about keeping stuff out of the config file, but a new constant is kind of the only reasonable way to select the database type. I propose YOURLS_DB_TYPE.

@iWantToKeepAnon
Copy link
Author

"YOURLS_DB_TYPE" would make sense. The entry point script triggers off "mysql" and "pgsql" as the docker database network names; which wouldn't work for non-docker setups of course.

@iWantToKeepAnon
Copy link
Author

@ozh, if you grant write permissions to YOURLS and docker-yourls; I can commit a "postgress" branch to your projects for testing/integrating.

This code is tested for clicks, adds, edits, etc... I am sure there are a lot of places that need additional help like the apis; but this is a start maybe.

FYI, I will be out for a few weeks starting this weekend so I may not get to commit first. But the code is here in my repo.

@dgw
Copy link
Member

dgw commented Mar 17, 2021

if you grant write permissions to YOURLS and docker-yourls

Make a pull request.

@LeoColomb LeoColomb linked a pull request Mar 17, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants