{"id":13834738,"url":"https://github.com/segmentio/ts-mysql-plugin","last_synced_at":"2025-04-05T01:05:07.819Z","repository":{"id":42876734,"uuid":"231647528","full_name":"segmentio/ts-mysql-plugin","owner":"segmentio","description":"A typescript language service plugin that gives superpowers to SQL tagged template literals.","archived":false,"fork":false,"pushed_at":"2023-10-02T23:29:46.000Z","size":68549,"stargazers_count":320,"open_issues_count":17,"forks_count":9,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-25T05:35:24.498Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/segmentio.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-01-03T18:59:11.000Z","updated_at":"2025-02-25T15:58:04.000Z","dependencies_parsed_at":"2024-01-15T19:14:36.760Z","dependency_job_id":null,"html_url":"https://github.com/segmentio/ts-mysql-plugin","commit_stats":{"total_commits":93,"total_committers":4,"mean_commits":23.25,"dds":"0.12903225806451613","last_synced_commit":"a8bd836b5e018e2be9e4eab69898474a32d71e7e"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segmentio%2Fts-mysql-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segmentio%2Fts-mysql-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segmentio%2Fts-mysql-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segmentio%2Fts-mysql-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/segmentio","download_url":"https://codeload.github.com/segmentio/ts-mysql-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271519,"owners_count":20911587,"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-08-04T14:00:51.660Z","updated_at":"2025-04-05T01:05:07.800Z","avatar_url":"https://github.com/segmentio.png","language":"TypeScript","readme":"# ts-mysql-plugin\n\n![Alt Text](https://github.com/segmentio/ts-mysql-plugin/workflows/CI/badge.svg)\n\nA typescript language service plugin that gives superpowers to SQL tagged template literals. Specifically aimed at the MySQL syntax.\n\n![Alt Text](https://github.com/segmentio/ts-mysql-plugin/raw/master/.github/demo.gif)\n\n## Features\n\n- Autocomplete for MySQL keywords\n- Autocomplete for table names and column names (powered by your schema)\n- Hover documentation for MySQL keywords\n- Hover documentation for tables and columns (powered by your schema)\n- Diagnostics for MySQL syntax errors\n- Diagnostics for invalid table names and column names (powered by your schema)\n- Diagnostics for invalid column types (powered by your schema)\n- Works in all major editors (VSCode, Sublime Text, Atom, etc.)\n\n## Installing\n\nStep 1: Yarn.\n\n```sh\nyarn add --dev ts-mysql-plugin\n```\n\nStep 2: TS Config.\n\nAdd the plugin to your compiler options in `tsconfig.json`. Note that `databaseUri` is optional, but recommended.\n\n```json\n{\n  \"compilerOptions\": {\n    \"plugins\": [\n      {\n        \"name\": \"ts-mysql-plugin\",\n        \"databaseUri\": \"mysql://USER@HOST/DB_NAME\"\n      }\n    ]\n  }\n}\n```\n\nYou can also optionally configure the MySQL version for the plugin to use (defaults to 5.7.12) This will ensure that the MySQL parser correctly notifies you about syntax errors for your version.\n\n```json\n{\n  \"mySQLVersion\": \"5.7.12\"\n}\n```\n\nYou can also optionally override the default tags (\"SQL\" and \"sql\") by adding a \"tags\" array to the config. For example, if you want the plugin to activate only on \"Sql\" tags:\n\n```json\n{\n  \"tags\": [\"Sql\"]\n}\n```\n\nIf you add `@ts-mysql-plugin ignore` in a comment at the top of a file, then the plugin will skip the file.\n\n## Developing\n\nRun the following:\n\n```shell\nyarn install\nyarn build\n```\n\n## Testing\n\nAssuming you've run all the steps in the \"Development\" section, then run the following:\n\n```shell\ncd e2e\nyarn install\ndocker-compose up -d\ncd ..\nyarn test\n```\n\n## Related\n\n- [ts-mysql-parser](https://github.com/stevenmiller888/ts-mysql-parser) - A standalone, grammar-complete MySQL parser\n- [ts-mysql-analyzer](https://github.com/stevenmiller888/ts-mysql-analyzer) - A MySQL query analyzer\n- [ts-mysql-autocomplete](https://github.com/stevenmiller888/ts-mysql-autocomplete) - An autocomplete engine for MySQL queries\n\n## License\n\n[MIT](https://tldrlegal.com/license/mit-license)\n","funding_links":[],"categories":["TypeScript","Language service plugins"],"sub_categories":["Optimization"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsegmentio%2Fts-mysql-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsegmentio%2Fts-mysql-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsegmentio%2Fts-mysql-plugin/lists"}