百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

ts-sql-plugin

> 编程语言
开源

TypeScript 语言服务插件,包含带标记的模板字符串 SQL 构建器。

193 stars0 点赞4 次浏览
访问官网GitHub

工具介绍

TypeScript 语言服务插件,包含带标记的模板字符串 SQL 构建器。

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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

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