Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
SQL query string builder for mysql
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.gitignore
README.md
mysquel.js
package.json
squel.js

README.md

mysquel - SQL query string builder for Javascript (tailored for mysql)

The original documentation is here [https://github.com/hiddentao/squel/blob/master/README.md]

Added functionality for ON DUPLICATE KEY UPDATE option for mysql insert

INSERT

// INSERT INTO test (f1, f2, f3, f4, f5) VALUES (1, 1.2, TRUE, "blah", NULL) ON DUPLICATE KEY UPDATE f2=1.2, f4="blah"
squel.insert()
    .into("test")
    .set("f1", 1)
    .set("f2", 1.2, { duplicateKeyUpdate: true })
    .set("f3", true)
    .set("f4", "blah", { duplicateKeyUpdate: true })
    .set("f5", null)
    .toString()
Something went wrong with that request. Please try again.