Skip to content

Database connection string with postgresql protocol assumes MongoDB #7687

Closed

Description

@pmmlo

New Issue Checklist

Issue Description

Developers using PostgreSQL can only use a URI with the prefix "postgres:" when "postgresql:" is also commonly used.

Steps to reproduce

  1. Set env var PARSE_SERVER_DATABASE_URI to a URI string starting with "postgresql://..."
  2. There will be a "MongoParseError" as it fallsback to MongoDB.

Actual Outcome

"MongoParseError: Invalid connection string"

Expected Outcome

Should validate as a PostgreSQL URI.

Environment

Node v17.0.1

Server

  • Parse Server version: 5.0.0-beta.1
  • Operating system: macOS 12.0.1
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Local

Database

  • System (MongoDB or Postgres): Postgres
  • Database version: Postgres 14.0.0
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Local

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): n/a
  • SDK version: n/a

Logs

Activity

  1. parse-github-assistant commented on Nov 10, 2021

    @parse-github-assistant

    Thanks for opening this issue!

    • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.
  2. cbaker6 commented on Nov 10, 2021

    @cbaker6
    Contributor

    Seems like this could be added.

    For reference: https://www.postgresql.org/docs/current/libpq-connect.html

    Parse Server connects to Postgres using pg-promise->node-postgres. Reference uri: https://node-postgres.com/features/connecting

  3. changed the title [-]Bug: Postgresql prefix URI fallsback to MongoDB[/-] [+]Postgresql prefix URI fallsback to MongoDB[/+] on Nov 10, 2021
  4. mtrezza commented on Nov 10, 2021

    @mtrezza
    Member

    Classified this as a bug as the Parse Server docs say:

    The postgres database adapter will be automatically loaded when you pass a valid postgres URL, for example: postgres://localhost:5432.

    A "valid postgres URL" includes the postgresql protocol, see docs:

    The URI scheme designator can be either postgresql:// or postgres://

    So it should work with either one. Severity low, as the workaround is to use the postgres protocol instead.

  5. added
    type:bugImpaired feature or lacking behavior that is likely assumed
    and removed on Nov 10, 2021
  6. changed the title [-]Postgresql prefix URI fallsback to MongoDB[/-] [+]Database connection string with postgresql protocol assumed MongoDB[/+] on Nov 10, 2021
  7. changed the title [-]Database connection string with postgresql protocol assumed MongoDB[/-] [+]Database connection string with postgresql protocol assumes MongoDB[/+] on Nov 10, 2021
  8. parseplatformorg commented on Jan 2, 2022

    @parseplatformorg
    Contributor

    🎉 This change has been released in version 5.0.0-alpha.15

  9. parseplatformorg commented on Mar 15, 2022

    @parseplatformorg
    Contributor

    🎉 This change has been released in version 5.0.0-beta.10

  10. parseplatformorg commented on Mar 18, 2022

    @parseplatformorg
    Contributor

    🎉 This change has been released in version 5.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:releasedReleased as stable versionstate:released-alphaReleased as alpha versionstate:released-betaReleased as beta versiontype:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions