{"_id":"mysql-oil","_rev":"14-740bd6f7f592a44bfd09ea08f747ada3","name":"mysql-oil","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"mysql-oil","version":"0.1.0","devDependencies":{"mysql":">=0.8.0"},"main":"./lib/node-mysql-oil","_id":"mysql-oil@0.1.0","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-3","_nodeVersion":"v0.2.4","dist":{"tarball":"https://registry.npmjs.org/mysql-oil/-/mysql-oil-0.1.0.tgz","shasum":"6e547d2548d64ef4f83b5244fc7b098da38dffb2","integrity":"sha512-Iy1GtnPnSkBsBf9x6bJxvsJZm5Rr/V3Q+uqgydZjO4Jf6JlBYy5auwPdUgpMddR0KHSw9FBvMA4Ytqhfh/gNVQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDsn4Aa+J+w83aM1ljMaRHWfE+/87CNXOGI2AKFWZxjMAiANbE1D0qzMtWwckCdiYIEMBZl6EJNWOTm+rsaUp3cKDA=="}]}},"0.2.0":{"name":"mysql-oil","version":"0.2.0","devDependencies":{"mysql":">=0.8.0"},"main":"./lib/node-mysql-oil","_id":"mysql-oil@0.2.0","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.8-1","_nodeVersion":"v0.2.0","dist":{"tarball":"https://registry.npmjs.org/mysql-oil/-/mysql-oil-0.2.0.tgz","shasum":"3ba86b0d0ebfe593d71e58c81983d141df14d0cb","integrity":"sha512-90MGJIzkwYfVhwuCQJvKy4XBBD8NE0BasviVFYYTGbf3TgemPxB9dYzpRG/62LP5/SpY/TyDjQlJa1yPkEG+4A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCEHUYUduk1nEKPp3OHgwONapd5Fmuikx63gAamsLuFoQIgM1SQWO3J6eHGN9Bwi31eI1ddnfL11KxE6BSOiVaQ9R0="}]}},"0.2.1":{"name":"mysql-oil","version":"0.2.1","devDependencies":{"mysql":">=0.8.0"},"main":"./lib/node-mysql-oil","_id":"mysql-oil@0.2.1","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.8-1","_nodeVersion":"v0.2.0","dist":{"tarball":"https://registry.npmjs.org/mysql-oil/-/mysql-oil-0.2.1.tgz","shasum":"77f02331acdae7117f09b39b279d74fc2b748a1a","integrity":"sha512-YaM42W9x1eN5fib2kn0iO8J/1xGLBsa6S+agQ5qX0aO1jaPBRi/eImMVe21LaT0jRfG8A6ot37Ln5kNFX993xA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBnfcsEtxoM962BAve/YJm03MYTE/edLSyMoqptvYRW1AiBAoAQm8FOCliQFuqYpkRQgmAtaBF1QDcw+wWF1VjoD/w=="}]}},"0.3.0":{"name":"mysql-oil","version":"0.3.0","devDependencies":{"mysql":">=0.8.0"},"main":"./lib/node-mysql-oil","_id":"mysql-oil@0.3.0","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.2.19","_nodeVersion":"v0.2.6","directories":{"lib":"./lib"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"fff9ba3567ee522f0f5bb9d1e02f52334a9c0833","tarball":"https://registry.npmjs.org/mysql-oil/-/mysql-oil-0.3.0.tgz","integrity":"sha512-6JlX69d5OopCeFcGnTk7c4vm7OpbGFQZN7E6LbmMspoltkB/bmqj0HYFUd8vLc9NH+l5WaUGE/f6LBk+HrwoIQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGPvi+CmwuaxVF7U8dco2CR9NTiIRmzqOkQu4heKedrZAiA/KNcX9PbUKT6n2aJSlfJ/nPHeZB/WAyReg4Mjx/TSjA=="}]}},"0.4.0":{"name":"mysql-oil","description":"slick api on top of node-mysql","version":"0.4.0","main":"./node-mysql-oil","scripts":{"test":"node test/test.js"},"dependencies":{"mysql":">=2.5.0"},"repository":{"type":"git","url":"http://github.com/rentzsch/node-mysql-oil.git"},"license":"MIT","gitHead":"4393dc14b18f35b5e689feb16e5f9e8b68162c47","bugs":{"url":"https://github.com/rentzsch/node-mysql-oil/issues"},"homepage":"https://github.com/rentzsch/node-mysql-oil","_id":"mysql-oil@0.4.0","_shasum":"9cde1d28abf91895ec896f0503092b6a6470cbb8","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"rentzsch","email":"jwr.git@redshed.net"},"maintainers":[{"name":"rentzsch","email":"jwr.git@redshed.net"}],"dist":{"shasum":"9cde1d28abf91895ec896f0503092b6a6470cbb8","tarball":"https://registry.npmjs.org/mysql-oil/-/mysql-oil-0.4.0.tgz","integrity":"sha512-Er23UWCkV56qevRYhZTnUyUFYddo5Q/DyNRCv+I875y1wt61v7sQj8fBZKe0Rk/j4d4t0x56Z9UxwE2ZP+lQcQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBO6vEJGQ+Mxj+BanqAIEzJ4Fi6VBMpeFGYrmrZBY2+4AiBcQT+kG0esRncIqnh9v1QE/dQvpqrfseXXaSdIVhfyjg=="}]}}},"maintainers":[{"name":"rentzsch","email":"jwr.git@redshed.net"}],"time":{"modified":"2022-06-20T18:14:29.601Z","created":"2011-03-31T21:33:43.641Z","0.1.0":"2011-03-31T21:33:43.641Z","0.2.0":"2011-03-31T21:33:43.641Z","0.2.1":"2011-03-31T21:33:43.641Z","0.3.0":"2011-03-31T21:33:43.641Z","0.4.0":"2014-09-18T16:11:09.285Z"},"description":"slick api on top of node-mysql","readme":"**node-mysql-oil**  \n*(a slick api on top [node-mysql](https://github.com/felixge/node-mysql))*\n\nOil makes SQL more *JavaScripty* by transforming JavaScript structures into SQL statements.\n\nFor example, this:\n\n\tvar db = require('mysql-oil').connect({db:'db_demo'});\n\tdb({\n\t\tselect: 'avg(t_main) as average, sum(t1.amount) as total',\n\t\tfrom: 't_main',\n\t\tjoin: [{inner: 't_join1 t1', on: 't1.main_id = t_main.id'},\n\t\t       {left: 't_join2 t2', on: 't2.join_id = t1.id'}],\n\t\twhere: ['t1.amount > ? AND t_main.cat = ?', 0, 'sale'],\n\t\tgroup_by: 't_main.cust_id',\n\t\thaving: 'total > 0',\n\t\torder_by: 't_main.cust_name',\n\t\tlimit: 100\n\t});\n\n\tdb({\n\t\tinsert_into: 't_test',\n\t\tvalues:{\n\t\t\tc_user: 'root',\n\t\t\tc_pass: 'pass',\n\t\t\tc_uid: 501\n\t\t}\n\t});\n\nInstead of this:\n\n\tvar MySQLClient = require('mysql').Client;\n\tvar db = new MySQLClient({user:'root', database:'db_demo'});\n\tdb.connect();\n\tdb.query(\n\t\t'select avg(t_main) as average, sum(t1.amount) as total '+\n\t\t'from: t_main inner join t_join1 t1 on t1.main_id = t_main.id '+\n\t\t'left join t_join2 t2 on t2.join_id = t1.id '+\n\t\t'where t1.amount > 0 group by t_main.id having total > 0 limit 1'\n\t);\n\n\tdb.query(\n\t\t'insert into t_test '+\n\t\t'(c_user, c_pass, c_uid) '+\n\t\t'values (\"root\", \"pass\", 501)'\n\t);\n\nJavaScript Strings, Numbers, Booleans and Dates are automatically marshaled into their SQL form.\n\nSee `test/test.js` for examples of API usage. Most everything is there: raw SQL support (for creating and dropping databases and tables), row inserting, selecting (with joins, group by, ordering, and limiting), updating, and deleting. Patches welcome.\n\nA word about security: arguments to `values` and placeholders (the `?` in queries) are escaped. All other inputs should be be hard-coded strings (not variables, especially when supplied by users).\n\n**Installation**\n\n`npm install mysql-oil`","homepage":"https://github.com/rentzsch/node-mysql-oil","repository":{"type":"git","url":"http://github.com/rentzsch/node-mysql-oil.git"},"bugs":{"url":"https://github.com/rentzsch/node-mysql-oil/issues"},"license":"MIT","readmeFilename":"README.markdown"}