Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

ts-sql-plugin

> 编程语言
Open source

TypeScript Language Service Plugin for SQL with a tagged template strings SQL builder.

193 stars0 likes4 views
WebsiteGitHub

About

TypeScript Language Service Plugin for SQL with a tagged template strings SQL builder.

ts-sql-plugin

TypeScript Language Service Plugin for SQL with a tagged template strings SQL builder. Inspired by andywer/squid

check sql error demo:

autocomplete demo:

Usage

run as a language service plugin

Install the plugin, run:

bash
npm install ts-sql-plugin -D

Then, configure the plugins section in your tsconfig.json:

…

Note: If you're using Visual Studio Code, you'll have to use the first approach above, with a path to the module, or run the "TypeScript: Select TypeScript Version" command and choose "Use Workspace Version", or click the version number between "TypeScript" and in the lower-right corner. Otherwise, VS Code will not be able to find your plugin. See https://github.com/microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin#testing-locally

run as a command line application

Install the plugin, run:

bash
npm install ts-sql-plugin -g

Then run:

bash
ts-sql-plugin -p ./my_ts_project -c 'psql -U postgres -c'

Then in your code:

In the code below, some of the table names or column names are intentionally wrong. ts-sql-plugin will show you the errors.

…

And there is a complete example using ts-sql-plugin and skm_ts in folder test_ts_sql_plugin.

Generate types from emitted sql

You can use pgtyped tool for generating types from your emitted sql via directive:

/* ts-sql-plugin:emit("SomeInterface") */
/* @name SomeInterface */

For generate types in realtime, use --watch option of cli.

VSCode syntax highlight extension

https://marketplace.visualstudio.com/items?itemName=darky.vscode-ts-sql-plugin

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言