{"id":20168969,"url":"https://github.com/mage/mage-vaulthelper-mysql","last_synced_at":"2026-06-09T10:31:49.531Z","repository":{"id":82165257,"uuid":"155501535","full_name":"mage/mage-vaulthelper-mysql","owner":"mage","description":null,"archived":false,"fork":false,"pushed_at":"2018-11-19T11:30:38.000Z","size":199,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-30T02:43:43.472Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mage.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-10-31T05:03:38.000Z","updated_at":"2018-11-19T11:30:39.000Z","dependencies_parsed_at":"2023-06-19T04:06:37.534Z","dependency_job_id":null,"html_url":"https://github.com/mage/mage-vaulthelper-mysql","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.1875,"last_synced_commit":"42021beda7c8e4d913bd69bc369e459e2fb9356e"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/mage/mage-vaulthelper-mysql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mage%2Fmage-vaulthelper-mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mage%2Fmage-vaulthelper-mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mage%2Fmage-vaulthelper-mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mage%2Fmage-vaulthelper-mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mage","download_url":"https://codeload.github.com/mage/mage-vaulthelper-mysql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mage%2Fmage-vaulthelper-mysql/sbom","scorecard":{"id":611411,"data":{"date":"2025-08-11","repo":{"name":"github.com/mage/mage-vaulthelper-mysql","commit":"42021beda7c8e4d913bd69bc369e459e2fb9356e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/14 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"51 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-7vm7-j8p7-h346","Warn: Project is vulnerable to: GHSA-8cxp-cjm8-fj36","Warn: Project is vulnerable to: GHSA-6f9p-g466-f8v8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-6gp3-h3jj-prx4","Warn: Project is vulnerable to: GHSA-fj58-h2fr-3pp2","Warn: Project is vulnerable to: GHSA-4gw3-8f77-f72c","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-mh6f-8j2x-4483","Warn: Project is vulnerable to: GHSA-9x64-5r7x-2q53","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-wrvr-8mpx-r7pp","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-4c7m-wxvm-r7gc","Warn: Project is vulnerable to: GHSA-pch5-whg9-qr2r","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq","Warn: Project is vulnerable to: GHSA-qgmg-gppg-76g5","Warn: Project is vulnerable to: GHSA-5v72-xg48-5rpm","Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T02:45:13.598Z","repository_id":82165257,"created_at":"2025-08-21T02:45:13.598Z","updated_at":"2025-08-21T02:45:13.598Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34103355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"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":[],"created_at":"2024-11-14T01:10:45.809Z","updated_at":"2026-06-09T10:31:49.508Z","avatar_url":"https://github.com/mage.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mage-vaulthelper-mysql\n\nAccessing vault backends directly is generally considered\nto be tedious in MAGE. This will help you by creating\nobject instances to access Couchbase directly, so that you may\ndo SQL calls.\n\n## Installation\n\n```shell\nnpm install --save mage-vaulthelper-mysql\n```\n\n## Usage\n\n### Managing table schema\n\nThis helpers provides methods to quickly create both topic tables and custom tables.\n\n\u003e ./lib/archivist/migrations/vaultName/0.0.1.ts\n\n```typescript\nimport * as mysql from 'mage-vaulthelper-mysql'\n\n// List topics with their indexes\nconst topics = {\n  auth: ['username']\n}\n\nexport const up = (vault: any, cb: any) =\u003e mysql.createTopicTables(vault, topics).then(cb).catch(cb)\nexport const down = (vault: any, cb: any) =\u003e mysql.dropTopicTables(vault, topics).then(cb).catch(cb)\n```\n\n\u003e ./lib/archivist/migrations/anotherVaultName/0.0.1.ts\n\n```typescript\nimport * as mysql from 'mage-vaulthelper-mysql'\n\n// List topics with their indexes\nconst tables = {\n  Ranking: [\n    { name: 'userId', type: 'VARCHAR(36)', pk: true },\n    { name: 'rank', type: 'SMALLINT' },\n  ]\n};\n\n\nexport const up = (vault: any, cb: any) =\u003e mysql.createTables(vault, tables).then(cb).catch(cb)\nexport const down = (vault: any, cb: any) =\u003e mysql.dropTables(vault, tables).then(cb).catch(cb)\n```\n\n### Making queries\n\nYou can connect to the vaults directly to run queries as needed.\n\n\u003e example code\n\n```typescript\ninterface ICount { count: number }\ntype CountList = ICount[]\nconst [{ count }]  = await query\u003cCountList\u003e(this.vault, `\n  SELECT COUNT(*) AS count FROM SomeTable'\n`)\n```\n\n### Integration with mage-validator\n\nIf you are using `mage-validator`, you can use the `ValidatedMySQLTopic` to\ndo custom read queries and have the output be converted into topic instances.\n\n\u003e ./lib/modules/user/topics/User.ts\n\n```typescript\nimport ValidatedMySQLTopic from 'mage-vaulthelper-mysql/ValidatedMySQLTopic`\n\nclass Index {\n  public userId: string\n}\n\nexport default class User extends ValidatedMySQLTopic {\n  // Index configuration\n  public static index = ['userId']\n  public static indexType = Index\n\n  // Vaults configuration (optional)\n  public static vaults = {\n    userVault: {}\n  }\n\n  public date: number = Date.now()\n}\n```\n\n\u003e ./lib/modules/user/index.ts\n\n```typescript\nimport * as mage from 'mage'\nimport UserTopic from `./topics/User`\n\nclass UserModule {\n  public async example(state: mage.core.IState) {\n    const users = await UserTopic.runSQLQuery(state, 'userVault', `\n      SELECT * from User ORDER BY JSON_EXTRACT(value, \"$.date\")\n    `)\n\n    console.log(users)\n  }\n}\n\nexport default new UserModule()\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmage%2Fmage-vaulthelper-mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmage%2Fmage-vaulthelper-mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmage%2Fmage-vaulthelper-mysql/lists"}