Comments (3)
If you specify the casting in the source ColumnSet
, it works just fine. Must be something wrong in your code. You will need to include a complete code example.
from pg-promise.
const cols = ['uid', {name:"content", mod:":json", cast:"jsonb"}, '?key'];
const cs = new pgp.helpers.ColumnSet(cols, {table:{table, schema}});
let rows = [{uid:'abc', key:'abc', content:{foo:'baa'}}];
const q = pgp.helpers.update(rows, cs) + ' WHERE t."uid" = v."key"';
In the original def content was just given as string. So without any additional parameters.
Due to the update strategy you open this value field with all the row contents. Content is a string there. And thats okay with me. But without a cast I run into that error.
EDIT: that sample seems to have the cast. brb, i check that ...
from pg-promise.
Okay. Im Sorry. It seems that the "cast" really did the job. Just on another position then where I thought. Thanks for that tesponse
from pg-promise.
Related Issues (20)
- ColumnSet does not recognize a table with schema HOT 6
- Question: Is it possible to use pg.helpers.ColumnSet to skip updating value based on column's new value
- CI issue HOT 3
- How safe is helpers concat against SQL injections HOT 1
- pg return error HOT 6
- CSV filter not treating Buffer (bytea) correctly HOT 6
- Using Promise.all inside tx() causes inconsistent data state HOT 7
- How can I explain my transaction ? HOT 1
- How can I delete a set of values ? HOT 1
- json formatting issue on update HOT 5
- High Vulnerability Security Issue HOT 1
- How to connect to serverless redshift using IAM permissions HOT 2
- Cannot read properties of undefined (reading 'split') HOT 1
- how to use tsrange in colum helpers set ? HOT 1
- pgp.as.format adds additional parenthesis around variable HOT 1
- Vulnerabilty: Sql injection when using columnset. HOT 10
- ESLint v9.0.0 upgrade HOT 1
- Issue with Postgres Version 16 HOT 3
- pgp.helpers.insert: table should accept fully qualified name as a string HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pg-promise.