Double quote escaping for placeholder substitution #45

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

Comments

Projects
None yet
2 participants
@rmechler-sencha

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 devdazed closed this in d30c777 May 11, 2012

@devdazed

This comment has been minimized.

Show comment Hide comment
@devdazed

devdazed May 11, 2012

Member

This fix was just published under 0.5.2

Member

devdazed commented May 11, 2012

This fix was just published under 0.5.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment