Coder Social home page Coder Social logo

Comments (5)

dresende avatar dresende commented on September 5, 2024

I'm confused too. Can you post an example?

from node-orm2.

dresende avatar dresende commented on September 5, 2024

Please give me some feedback, some versions of postgres, node, ...

from node-orm2.

preslavrachev avatar preslavrachev commented on September 5, 2024

Found the issue and partially solved it.

The initial connection string:
postgresql://user:pass@localhost:5432/db_name

When I used it in orm.connect, I put a breakpoint at the point where ORM converts the string to an object of options. The following opts object was generated:

{

auth: "user:pass",
database: "db_name",
host: "localhost:5432",
hostname: "localhost",
href: "postgresql://user:pass@localhost:5432/db_name",
password: "pass",
path: "/db_name",
pathname: "/db_name",
port: "5432",
protocol: "postgresql:",
query: {},
search: "",
slashes: true,
user: "user"

}

Instead of a connection url string, I created an options object with this data, and used it in orm.connect. It blew up with the same error.
Then, I changed host: "localhost:5432" with host: "localhost:", and it started working!

Postgres ver: 9.1
Node ver: 0.8.5
npm ver: 1.1.46

from node-orm2.

dresende avatar dresende commented on September 5, 2024

So the problem is the port definition? Hmmm... I have to check that..

from node-orm2.

dresende avatar dresende commented on September 5, 2024

Could you try the latest commit? I change the way drivers use the config. More specifically, mysql and postgres will try to use the url string before trying the parsed object.

from node-orm2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.