Giter Club home page Giter Club logo

Comments (10)

justinlindh avatar justinlindh commented on June 24, 2024

The following may solve the issue (I've only tested that it's writing to the db correctly, haven't gotten far enough into my implementation to see whether there's problems downstream with this):

user-identity.json

    "profile": {
      "type": "Object",
      "postgresql": {
        "dataType": "text",
        "nullable": "NO"
      }
    },

(Of course, another valid workaround is to extend off of this base model and override the "profile" with that datasource definition... maybe that's the intended design for this component and I just didn't realize it)

from loopback-component-passport.

loay avatar loay commented on June 24, 2024

Hi @justinlindh
What version of npm and node are you using?
I tested these components with npm 3.3.9 and node 4.x as well as installed loopback@2 and it works fine on my end.
The only issue I got was the loopback version so I installed loopback@2 then tested and it is went through fine.
If you are still having these issues, please let me know. Thanks.

from loopback-component-passport.

justinlindh avatar justinlindh commented on June 24, 2024

Reproducing the problem likely depends on how much data is being returned in the profile field. It's possible that minimal profiles won't trigger the problem. I realize that makes this significantly more difficult to reproduce, but another check could be directly against the datastore: if it's creating the profile column in postgresq is still being created as varchar(1024), it's likely still an issue.

I haven't tried to reproduce this lately. I'll try to do that as soon as I get a chance; there's a possibility that this has been resolved elsewhere, or handled better (maybe truncating the profile data prior to inserting).

from loopback-component-passport.

tkaplan avatar tkaplan commented on June 24, 2024

Any update on this issue? I'm having issues saving manyEmbedded model in postgresql because it looks like it serializes to varchar. I could change the db manually, but I prefer not to. Where would I put the following in the relationship for embedded model:

postgresql: {dataType: "text"}

from loopback-component-passport.

taras avatar taras commented on June 24, 2024

I encountered the same problem with GitHub profiles.

from loopback-component-passport.

taras avatar taras commented on June 24, 2024

I was able to overcome the problem by extending the built in UserIdentity model and overloading the profile property definition

{
  "name": "userIdentity",
  "plural": "userIdentities",
  "base": "UserIdentity",
  "properties": {
    "profile": {
      "type": "Object",
      "postgresql": {
        "columnName": "profile",
        "dataType": "character varying",
        "dataLength": 10000
      }
    }
  },
  "validations": [],
  "relations": {
    "user": {
      "type": "belongsTo",
      "model": "user",
      "foreignKey": "userId"
    }
  },
  "acls": [],
  "methods": []
}

from loopback-component-passport.

loay avatar loay commented on June 24, 2024

Hi @tkaplan
Does @taras fix work for you? If not, please let me know and I will see what we can do about it.

from loopback-component-passport.

davidcheung avatar davidcheung commented on June 24, 2024

It looks like this PR addresses this issue, the field is mapped as TEXT now https://github.com/strongloop/loopback-connector-postgresql/blob/ff75c74ece50b900f18ed4d027ac4ffa82728f02/lib/migration.js#L530

/cc @loay

from loopback-component-passport.

loay avatar loay commented on June 24, 2024

Hi @justinlindh It looks like the issue is fixed as per the PR mentioned in the previous comment.
Can you please confirm? Thanks.

from loopback-component-passport.

justinlindh avatar justinlindh commented on June 24, 2024

Yeah, this has been resolved.

from loopback-component-passport.

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.