Skip to content
프로젝트

소개

A typescript language service plugin that gives superpowers to SQL tagged template literals.

데이터 및 분석

이 수치를 측정하는 방법

What you can do

  • Autocomplete for MySQL keywords
  • Autocomplete for table names and column names (powered by your schema)
  • Hover documentation for MySQL keywords
  • Hover documentation for tables and columns (powered by your schema)

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
-1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

ts-mysql-plugin

Alt Text

A typescript language service plugin that gives superpowers to SQL tagged template literals. Specifically aimed at the MySQL syntax.

Alt Text

Features

  • Autocomplete for MySQL keywords
  • Autocomplete for table names and column names (powered by your schema)
  • Hover documentation for MySQL keywords
  • Hover documentation for tables and columns (powered by your schema)
  • Diagnostics for MySQL syntax errors
  • Diagnostics for invalid table names and column names (powered by your schema)
  • Diagnostics for invalid column types (powered by your schema)
  • Works in all major editors (VSCode, Sublime Text, Atom, etc.)

Installing

Step 1: Yarn.

yarn add --dev ts-mysql-plugin

Step 2: TS Config.

Add the plugin to your compiler options in tsconfig.json. Note that databaseUri is optional, but recommended.

{
  "compilerOptions": {
    "plugins": [
      {
        "name": "ts-mysql-plugin",
        "databaseUri": "mysql://USER@HOST/DB_NAME"
      }
    ]
  }
}

You 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.

{
  "mySQLVersion": "5.7.12"
}

You 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:

{
  "tags": ["Sql"]
}

If you add @ts-mysql-plugin ignore in a comment at the top of a file, then the plugin will skip the file.

Developing

Run the following:

yarn install
yarn build

Testing

Assuming you've run all the steps in the "Development" section, then run the following:

cd e2e
yarn install
docker-compose up -d
cd ..
yarn test

Related

License

MIT

관련 프로젝트 살펴보기

불러오는 중…