Skip to content
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

Can't db.insert() #38

Open
AndrewRayCode opened this issue Jan 7, 2019 · 4 comments
Open

Can't db.insert() #38

AndrewRayCode opened this issue Jan 7, 2019 · 4 comments

Comments

@AndrewRayCode
Copy link

AndrewRayCode commented Jan 7, 2019

https://github.com/db-migrate/pg/blob/master/index.js#L564-L566

    arguments[index] = arguments[index].map(function (value) {
      return typeof value === 'string' ? value : JSON.stringify(value);
    });

What is this function doing? db-migrate#insert doesn't do anything with de-stringifying json

https://github.com/db-migrate/db-migrate-base/blob/7af3f80bad7fa5c64509a4435cce68891403c0d1/index.js#L339


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@AndrewRayCode
Copy link
Author

Thoughts here @wzrdtales? It looks like you've worked on both this library and the base one

@wzrdtales
Copy link
Member

insert is indeed target for redesign. In this case the pg driver insert, came from a loooong distant commit. This was before I moved out the drivers from the core repo though. So here is the original commit this introduced this:

db-migrate/node-db-migrate@680adad

I have absolutely no idea what the sense behind it is though.

@wzrdtales
Copy link
Member

wzrdtales commented Jan 8, 2019

Here is the merge request it came from db-migrate/node-db-migrate#185
After looking into that, it was simply support for json types in pg specifically.

@droda59
Copy link

droda59 commented Nov 20, 2019

@AndrewRayCode how did you manage to work around this?

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

No branches or pull requests

3 participants