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

Double quote escaping for placeholder substitution #45

Closed
rmechler-sencha opened this issue May 7, 2012 · 1 comment
Closed

Double quote escaping for placeholder substitution #45

rmechler-sencha opened this issue May 7, 2012 · 1 comment

Comments

@rmechler-sencha
Copy link

I'm trying to store a column value that contains double quotes, by substituting a placeholder using a string, e.g.,

  var data = '{username: "bob"}';
  pool.cql("INSERT INTO MyColumnFamily (id, data) VALUES ('1', %s)", [data], function(err){
      ...

the value that ends up being stored is this:

cqlsh:keyspace1> select * from MyColumnFamily where id = '1';
 id | data
----+-----------------------
 1 | {username: \\"bob\\"}

when what I really want is this:

cqlsh:keyspace1> select * from MyColumnFamily where id = '1';
 id | data
----+-----------------------
 1 | {username: "bob"}

there doesn't seem to be any way around this, unless I specify the value directly in the query (no substitution).

Might be related to issue #36

@devdazed
Copy link
Contributor

This fix was just published under 0.5.2

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

2 participants