Skip to content
This repository has been archived by the owner on Mar 4, 2019. It is now read-only.

Disable junctions for insert #550

Closed
samjeffress opened this issue Feb 22, 2018 · 6 comments
Closed

Disable junctions for insert #550

samjeffress opened this issue Feb 22, 2018 · 6 comments

Comments

@samjeffress
Copy link
Contributor

Hi,
My objects that I'm storing have both standard postgres columns, and jsonb for storing an original request object.
I've renamed some columns in my tables to use snake case, and now I have columns that match a nested property name in my object. I'm now getting errors this.records[0][j].map is not a function which is from lib/statement/insert.js -> format function. (it's resolving to string values, which aren't mappable)
If I could disable junctions then this wouldn't be an issue - is this available?
Thanks
Sam

@dmfay
Copy link
Owner

dmfay commented Feb 22, 2018

It is not, but adding an ignoreJunctions option for inserts would be pretty straightforward if you'd like to submit a pull request.

@samjeffress
Copy link
Contributor Author

Added a pr - #551. I went with deepInsert as the option name because that's talked about in doco rather than the junctions

@dmfay dmfay closed this as completed in b66e255 Feb 22, 2018
@dmfay
Copy link
Owner

dmfay commented Feb 22, 2018

Released as 4.7.0, thanks!

@samjeffress
Copy link
Contributor Author

Pleasure :) thanks for your quick feedback 👍

@tylercollier
Copy link

Is there a way to set global config options for massivejs (I looked all through the doc, which is well written and organized, and didn't see it)? I'd like to default { deepInsert: false } everywhere.

@dmfay
Copy link
Owner

dmfay commented Mar 4, 2018

There are global options but that is not one of them. I've been thinking about changing how that's enabled somehow for v5, but I've also been pretty busy. I've just thrown a v5 branch up if you or anyone else wants to make a pull request against it.

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

No branches or pull requests

3 participants