{"id":17091368,"url":"https://github.com/jhurliman/node-mysql-simple","last_synced_at":"2025-04-12T22:35:30.174Z","repository":{"id":66019701,"uuid":"1918647","full_name":"jhurliman/node-mysql-simple","owner":"jhurliman","description":"Provides connection pooling and a simplified interface on top of node-mysql and generic-pool","archived":false,"fork":false,"pushed_at":"2011-12-04T06:07:54.000Z","size":93,"stargazers_count":23,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T16:39:04.844Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jhurliman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-06-19T08:22:02.000Z","updated_at":"2021-12-30T11:35:19.000Z","dependencies_parsed_at":"2023-02-19T21:15:22.412Z","dependency_job_id":null,"html_url":"https://github.com/jhurliman/node-mysql-simple","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhurliman%2Fnode-mysql-simple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhurliman%2Fnode-mysql-simple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhurliman%2Fnode-mysql-simple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhurliman%2Fnode-mysql-simple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhurliman","download_url":"https://codeload.github.com/jhurliman/node-mysql-simple/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248642311,"owners_count":21138350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T13:58:25.218Z","updated_at":"2025-04-12T22:35:30.150Z","avatar_url":"https://github.com/jhurliman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mysql-simple #\n\nProvides connection pooling and a simplified interface on top of node-mysql and \ngeneric-pool. The goal is to abstract away the details of MySQL connection \nhandling and provide single-method interfaces to the database.\n\n## Installation ##\n\nUse NPM to install:\n\n    npm install mysql-simple\n\n## Usage ##\n\n    var database = require('mysql-simple');\n    // Port number is optional\n    database.init('username', 'password', 'mydatabase', 'localhost', 3306);\n    \n    database.query('SELECT * FROM users WHERE active=? LIMIT 10', [true],\n      function(err, results)\n    {\n      if (err) {\n        console.log('error fetching some active users: ' + err);\n        return;\n      }\n      \n      for (var i = 0; i \u003c results.length; i++)\n        console.log('got active user ' + results[i]);\n    });\n    \n    database.querySingle('SELECT id,name FROM users WHERE id=?', [42],\n      function(err, result)\n    {\n      if (err) {\n        console.log('error fetching a single active user: ' + err);\n        return;\n      }\n      \n      if (result)\n        console.log('user exists!');\n      else\n        console.log('user does not exist');\n    });\n    \n    database.queryMany('SELECT * FROM users WHERE active=?', [true],\n      function(row) // Row callback\n    {\n      console.log('got active user ' + row);\n    },\n      function(err) // End callback\n    {\n      if (err) {\n        console.log('error fetching all active users: ' + err);\n        return;\n      }\n    });\n    \n    database.nonQuery('INSERT INTO users (name, email) VALUES (?, ?)',\n      ['newuser', 'newuser@gmail.com'], function(err, info)\n    {\n      if (err) {\n        console.log('error inserting new user: ' + err);\n        return;\n      }\n      \n      console.log('inserted new user, id = ' + info.insertId);\n    });\n\n## Sponsors ##\n\n* [cull.tv](http://cull.tv/) - New music television\n\n## License ##\n\n(The MIT License)\n\nCopyright (c) 2011 Cull TV, Inc. \u0026lt;jhurliman@cull.tv\u0026gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhurliman%2Fnode-mysql-simple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhurliman%2Fnode-mysql-simple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhurliman%2Fnode-mysql-simple/lists"}