romeerez / orchid-orm-benchmarks

Orchid ORM benchmarks
https://orchid-orm.netlify.app/guide/benchmarks.html
12 stars 4 forks source link

I am getting this when I invoke "npm run db create" #1

Closed capaj closed 1 year ago

capaj commented 1 year ago
 ●  npm run db create 

> orchid-orm-benchmarks@0.0.0 db
> ts-node src/scripts/db.ts create

config: {
  databaseUrl: 'postgres://postgres:@localhost:5432/orchid-orm-benchmarks'
}
/home/capaj/oss/orchid-orm-examples/packages/benchmarks/node_modules/pg/lib/sasl.js:24
    throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string')
          ^
Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string
    at Object.continueSession (/home/capaj/oss/orchid-orm-examples/packages/benchmarks/node_modules/pg/lib/sasl.js:24:11)
    at Client._handleAuthSASLContinue (/home/capaj/oss/orchid-orm-examples/packages/benchmarks/node_modules/pg/lib/client.js:257:10)
    at Connection.emit (node:events:513:28)
    at Connection.emit (node:domain:489:12)
    at /home/capaj/oss/orchid-orm-examples/packages/benchmarks/node_modules/pg/lib/connection.js:114:12
    at Parser.parse (/home/capaj/oss/orchid-orm-examples/packages/benchmarks/node_modules/pg-protocol/src/parser.ts:104:9)
    at Socket.<anonymous> (/home/capaj/oss/orchid-orm-examples/packages/benchmarks/node_modules/pg-protocol/src/index.ts:7:48)
    at Socket.emit (node:events:513:28)
    at Socket.emit (node:domain:489:12)
    at addChunk (node:internal/streams/readable:315:12)
 ✘ capaj@capaj-ryzen-7-5900x  ~/oss/orchid-orm-examples/p

config is just a console log I added

Any idea why this might be?

romeerez commented 1 year ago

The password is missing, but is required?

romeerez commented 1 year ago

Or, as it seems from this pg issue, pg expects an empty string for password, but my lib doesn't provide a password at all, I'll look.

capaj commented 1 year ago

out of curiosity-why are you using node-postgres rather than https://github.com/porsager/postgres ? Isn't that slower?

capaj commented 1 year ago

ah this was just missing the password. I forgot you need to have postgres://postgres:postgres@localhost:5432/orchid-orm-benchmarks, not just postgres://postgres:@localhost:5432/orchid-orm-benchmarks

closing. Will open a PR to change this, because it handles wrong password much more gracefully than no password.

romeerez commented 1 year ago

I have an empty password, so in my .env it's postgres://postgres:@localhost:5432/orchid-orm-benchmarks and it's okay.

For the porsager/postgres, I'm supporting only pg for simplicity as it's "fast enough", more such libraries will be supported in the future.