Permalink
Browse files

escaping strings with single quotes for pg compatibility.

  • Loading branch information...
1 parent 58d70aa commit 785696eff9f9c148d66ce9b682eb2b72276f839d @nl0 nl0 committed Aug 17, 2012
Showing with 15 additions and 15 deletions.
  1. +1 −1 docs/squel.html
  2. +1 −1 squel.js
  3. +1 −1 squel.min.js
  4. +1 −1 src/squel.coffee
  5. +1 −1 test/delete.coffee
  6. +1 −1 test/expression.coffee
  7. +4 −4 test/insert.coffee
  8. +1 −1 test/select.coffee
  9. +4 −4 test/update.coffee
View
@@ -116,7 +116,7 @@
<span class="nv">value = </span><span class="k">if</span> <span class="nx">value</span> <span class="k">then</span> <span class="s">&quot;TRUE&quot;</span> <span class="k">else</span> <span class="s">&quot;FALSE&quot;</span>
<span class="k">else</span> <span class="k">if</span> <span class="s">&quot;number&quot;</span> <span class="o">isnt</span> <span class="k">typeof</span> <span class="nx">value</span>
<span class="k">if</span> <span class="kc">false</span> <span class="o">is</span> <span class="nx">options</span><span class="p">.</span><span class="nx">usingValuePlaceholders</span>
- <span class="nv">value = </span><span class="s">&quot;\&quot;</span><span class="si">#{</span><span class="nx">value</span><span class="si">}</span><span class="s">\&quot;&quot;</span>
+ <span class="nv">value = </span><span class="s">&quot;&#39;</span><span class="si">#{</span><span class="nx">value</span><span class="si">}</span><span class="s">&#39;&quot;</span>
<span class="nx">value</span></pre></div> </td> </tr> <tr id="section-27"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-27">&#182;</a> </div> <p>Base class for query builders which support WHERE, ORDER and LIMIT clauses.</p> </td> <td class="code"> <div class="highlight"><pre><span class="k">class</span> <span class="nx">WhereOrderLimit</span>
<span class="nv">wheres: </span><span class="kc">null</span>
<span class="nv">orders: </span><span class="kc">null</span>
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -199,7 +199,7 @@ formatValue = (value, options) ->
value = if value then "TRUE" else "FALSE"
else if "number" isnt typeof value
if false is options.usingValuePlaceholders
- value = "\"#{value}\""
+ value = "'#{value}'"
value
View
@@ -26,7 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
vows = require "vows"
assert = require "assert"
-squel = require "../squel.min"
+squel = require "../src/squel"
tu = require "./testutils"
suite = vows.describe("DELETE query builder")
View
@@ -26,7 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
vows = require "vows"
assert = require "assert"
-expr = (require "../squel.min").expr
+{expr} = require "../src/squel"
tu = require "./testutils"
suite = vows.describe("Expression builder")
View
@@ -26,7 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
vows = require "vows"
assert = require "assert"
-squel = require "../squel.min"
+squel = require "../src/squel"
tu = require "./testutils"
inst = (options) -> squel.insert(options)
@@ -91,7 +91,7 @@ suite.addBatch
topic: (obj) -> obj.set("f5","blah")
'then when set("f6",null) is called':
topic: (obj) -> obj.set("f6",null)
- 'then when toString() is called': tu.contextAssertStringEqual 'INSERT INTO test (f1, f2, f3, f4, f5, f6) VALUES (1, 1.2, TRUE, FALSE, "blah", NULL)'
+ 'then when toString() is called': tu.contextAssertStringEqual "INSERT INTO test (f1, f2, f3, f4, f5, f6) VALUES (1, 1.2, TRUE, FALSE, 'blah', NULL)"
@@ -134,10 +134,10 @@ suite.addBatch
topic: -> inst().set("f","v")
'when into("test") is called':
topic: (obj) -> obj.into("test")
- 'then when toString() is called': tu.contextAssertStringEqual 'INSERT INTO test (f) VALUES ("v")'
+ 'then when toString() is called': tu.contextAssertStringEqual "INSERT INTO test (f) VALUES ('v')"
'then when into("test2") is called':
topic: (obj) -> obj.into("test2")
- 'then when toString() is called': tu.contextAssertStringEqual 'INSERT INTO test2 (f) VALUES ("v")'
+ 'then when toString() is called': tu.contextAssertStringEqual "INSERT INTO test2 (f) VALUES ('v')"
View
@@ -26,7 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
vows = require "vows"
assert = require "assert"
-squel = require "../squel.min"
+squel = require "../src/squel"
tu = require "./testutils"
inst = -> squel.select()
View
@@ -26,7 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
vows = require "vows"
assert = require "assert"
-squel = require "../squel.min"
+squel = require "../src/squel"
tu = require "./testutils"
inst = (options) -> squel.update(options)
@@ -131,7 +131,7 @@ suite.addBatch
topic: (obj) -> obj.set("f5","blah")
'then when set("f6",null) is called':
topic: (obj) -> obj.set("f6",null)
- 'then when toString() is called': tu.contextAssertStringEqual 'UPDATE test SET f1 = 1, f2 = 1.2, f3 = TRUE, f4 = FALSE, f5 = "blah", f6 = NULL'
+ 'then when toString() is called': tu.contextAssertStringEqual "UPDATE test SET f1 = 1, f2 = 1.2, f3 = TRUE, f4 = FALSE, f5 = 'blah', f6 = NULL"
suite.addBatch
@@ -173,10 +173,10 @@ suite.addBatch
topic: (obj) -> obj.table("test")
'then when table("test2") is called':
topic: (obj) -> obj.table("test2")
- 'then when toString() is called': tu.contextAssertStringEqual 'UPDATE test, test2 SET f = "v"'
+ 'then when toString() is called': tu.contextAssertStringEqual "UPDATE test, test2 SET f = 'v'"
'then when table("test3","a") is called':
topic: (obj) -> obj.table("test3","a")
- 'then when toString() is called': tu.contextAssertStringEqual 'UPDATE test, test2, test3 AS `a` SET f = "v"'
+ 'then when toString() is called': tu.contextAssertStringEqual "UPDATE test, test2, test3 AS `a` SET f = 'v'"

0 comments on commit 785696e

Please sign in to comment.