Skip to content

varchar[] doesn't work #434

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

Closed
etodanik opened this issue May 3, 2020 · 1 comment
Closed

varchar[] doesn't work #434

etodanik opened this issue May 3, 2020 · 1 comment
Labels

Comments

@etodanik
Copy link

etodanik commented May 3, 2020

Steps to reproduce

  1. Set up a model with a varchar[] field:
  @property({
    type: 'array',
    itemType: 'string',
    postgresql: {
      columnName: "roles",
      dataType: "varchar[]",
      nullable: "YES"
    }
  })
  roles?: string[];
  1. Try to save something.

Current Behavior

Unhandled error in POST /users: 500 error: malformed array literal: "["customer"]"
    at Connection.parseE (/Users/danny/src/ecommin-api/node_modules/pg/lib/connection.js:581:48)
    at Connection.parseMessage (/Users/danny/src/ecommin-api/node_modules/pg/lib/connection.js:380:19)
    at Socket.<anonymous> (/Users/danny/src/ecommin-api/node_modules/pg/lib/connection.js:116:22)
    at Socket.emit (events.js:198:13)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:269:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

Expected Behavior

Supposed to save an array of strings

Related Issues

Could this be related?
#428

@etodanik etodanik added the bug label May 3, 2020
@agnes512
Copy link
Contributor

agnes512 commented May 7, 2020

This should be fixed in #428. The patched has been released in version 5.0.1. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants