{"id":14972188,"url":"https://github.com/prettyblueberry/mysql-error-keys","last_synced_at":"2025-10-26T18:31:39.691Z","repository":{"id":146320444,"uuid":"611201005","full_name":"prettyblueberry/mysql-error-keys","owner":"prettyblueberry","description":"NPM module: a list of error keys in Mysql","archived":false,"fork":false,"pushed_at":"2023-07-27T02:22:31.000Z","size":78,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-16T10:28:38.681Z","etag":null,"topics":["constants","error-code","error-codes","error-message","error-messages","mysql","mysql-database","mysql-error","npm-module","npm-package"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/mysql-error-keys","language":null,"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/prettyblueberry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-08T10:31:50.000Z","updated_at":"2024-11-12T11:46:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"ecb5c54a-80b0-4c66-b770-ebe7baa94fba","html_url":"https://github.com/prettyblueberry/mysql-error-keys","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.3571428571428571,"last_synced_commit":"b9c2dfb2cde08f9915132d3c9be2cddea29ac42c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/prettyblueberry/mysql-error-keys","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettyblueberry%2Fmysql-error-keys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettyblueberry%2Fmysql-error-keys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettyblueberry%2Fmysql-error-keys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettyblueberry%2Fmysql-error-keys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prettyblueberry","download_url":"https://codeload.github.com/prettyblueberry/mysql-error-keys/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettyblueberry%2Fmysql-error-keys/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281055227,"owners_count":26436350,"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","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["constants","error-code","error-codes","error-message","error-messages","mysql","mysql-database","mysql-error","npm-module","npm-package"],"created_at":"2024-09-24T13:46:30.992Z","updated_at":"2025-10-26T18:31:39.337Z","avatar_url":"https://github.com/prettyblueberry.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# mysql-error-keys\n\n[![NPM Version](https://img.shields.io/npm/v/mysql-error-keys.svg)](https://www.npmjs.com/package/mysql-error-keys)\n[![NPM Downloads](https://img.shields.io/npm/dt/mysql-error-keys.svg?style=flat)](https://www.npmjs.com/package/mysql-error-keys)\n[![npm](https://img.shields.io/github/stars/prettyblueberry/mysql-error-keys.svg)](https://github.com/prettyblueberry/mysql-error-keys)\n[![Issues](https://img.shields.io/github/issues-raw/prettyblueberry/mysql-error-keys.svg?maxAge=25000)](https://github.com/prettyblueberry/mysql-error-keys/issues)\n[![NPM License](https://img.shields.io/npm/l/mysql-error-keys.svg?style=flat)](https://github.com/prettyblueberry/mysql-error-keys/blob/main/LICENSE)\n\n[//]: # ([![fork]\u0026#40;https://img.shields.io/github/forks/prettyblueberry/mysql-error-keys.svg\u0026#41;]\u0026#40;https://github.com/prettyblueberry/mysql-error-keys/fork\u0026#41;)\n\nA list of name keys (string, not number) of `MySQL error messages`.\n\nMySQL has lots of error messages, and it makes you to handle many raw key strings or code numbers in your coding.\nHere is an example.\n```javascript\nauthController.signUp({name, email, pwd}).then((res)=\u003e{\n    console.log(\"success!\");\n}).catch((err)=\u003e{\n    if(err.response.data.code === \"ER_DUP_ENTRY\"){ // this is raw string :(\n        console.log(\"error: email duplicated!\");\n        return;\n    }\n});\n```\nAs you can see, the code uses raw string \"ER_DUP_ENTRY\". It is not good for coding style and quality.\n\nIf you use this list, you can handle error keys as predefined constants to avoid bugs and for better coding style, and you can experience autocomplete of the list in editor of IDEs like `Visual Studio Code` and `JetBrains WebStorm`.\n\n## Install\n\n```bash\n$ npm install --save mysql-error-keys\n```\nor\n```bash\n$ yarn add mysql-error-keys\n```\n\n## Usage\n\n### Using Import\n```javascript\nimport { mek } from 'mysql-error-keys';\n\nauthController.signUp({name, email, pwd}).then((res)=\u003e{\n    console.log(\"success!\");\n}).catch((err)=\u003e{\n    if(err.response.data.code === mek.ER_DUP_ENTRY){\n        console.log(\"error: email duplicated!\");\n        return;\n    }\n});\n```\nor\n```javascript\nimport { ER_DUP_ENTRY } from 'mysql-error-keys';\n\nauthController.signUp({name, email, pwd}).then((res)=\u003e{\n    console.log(\"success!\");\n}).catch((err)=\u003e{\n    if(err.response.data.code === ER_DUP_ENTRY){\n        console.log(\"error: email duplicated!\");\n        return;\n    }\n});\n```\n\n### Using Require\n```javascript\nconst mek = require('mysql-error-keys')\nauthController.signUp({name, email, pwd}).then((res)=\u003e{\n    console.log(\"success!\");\n}).catch((err)=\u003e{\n    if(err.response.data.code === mek.ER_DUP_ENTRY){\n        console.log(\"error: email duplicated!\");\n        return;\n    }\n});\n```\nor\n\n```javascript\nconst { ER_DUP_ENTRY } = require('mysql-error-keys')\n\nauthController.signUp({name, email, pwd}).then((res)=\u003e{\n    console.log(\"success!\");\n}).catch((err)=\u003e{\n    if(err.response.data.code === ER_DUP_ENTRY){\n        console.log(\"error: email duplicated!\");\n        return;\n    }\n});\n```\n\n## Error Message Reference\n[MySQL Error Message Reference](https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html)\n\n\n## Please Be a Contributor !\nAs you know, this module always should be same as the latest version of `MySQL Error Messages`. `MySQL Error Messages` might be updated and I might miss it.\n\nSo if you find an issue, please feel free to make a **pull request** and [an issue](https://github.com/prettyblueberry/mysql-error-keys/issues/new).\n\nGitHub Repository: [https://github.com/prettyblueberry/mysql-error-keys](https://github.com/prettyblueberry/mysql-error-keys)\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettyblueberry%2Fmysql-error-keys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprettyblueberry%2Fmysql-error-keys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettyblueberry%2Fmysql-error-keys/lists"}