{"id":44086,"library":"typescript-sql-tagged-template-plugin","title":"TypeScript SQL Tagged Template Plugin","description":"A TypeScript language service plugin that adds type checking and syntax error detection for SQL queries written inside tagged template literals. Currently supports PostgreSQL only. Version 0.3.0 provides diagnostics, type checking against a user-supplied database schema file, and formatting via pgFormatter (requires Perl). It is configured in tsconfig.json and works in any editor with TypeScript language server plugin support. The plugin is maintained and updated infrequently; it is a specialized tool for developers using raw SQL strings in TypeScript.","status":"active","version":"0.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/frigus02/typescript-sql-tagged-template-plugin","tags":["javascript","TypeScript","sql","templates"],"install":[{"cmd":"npm install typescript-sql-tagged-template-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add typescript-sql-tagged-template-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add typescript-sql-tagged-template-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; works as a language service plugin, requires TypeScript to be installed","package":"typescript","optional":false}],"imports":[{"note":"This is a language service plugin, not a runtime module. It is loaded by the TypeScript language server via settings.","symbol":"Plugin","correct":"No direct import needed; configure in tsconfig.json plugins array"}],"quickstart":{"code":"// Ensure TypeScript is installed in your project\nnpm install --save-dev typescript typescript-sql-tagged-template-plugin\n\n// tsconfig.json\n{\n  \"compilerOptions\": {\n    \"plugins\": [{\n      \"name\": \"typescript-sql-tagged-template-plugin\",\n      \"schemaFile\": \"./path/to/database-schema.json\"\n    }]\n  }\n}\n\n// Example SQL tagged template (requires a custom sql tag function)\nimport { sql } from 'some-sql-tag-library';\nconst query = sql`SELECT * FROM users WHERE id = ${userId}`;","lang":"typescript","description":"Shows installation, tsconfig configuration, and a basic SQL tagged template usage that the plugin analyzes."},"warnings":[{"fix":"Disable the 'TypeScript > Tsserver: Use Separate Syntax Server' setting in VS Code.","message":"VS Code uses a separate syntax server that does not load tsconfig plugins by default, breaking formatting features.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Ensure you are using PostgreSQL syntax; for other databases, find alternative plugins.","message":"The plugin only supports PostgreSQL. Other SQL dialects like MySQL, SQLite are not checked.","severity":"deprecated","affected_versions":"*"},{"fix":"Generate a database schema JSON file using the provided script (scripts/schema/index.js) and configure 'schemaFile' in tsconfig.","message":"Schema file is required for type checking; without it, only basic syntax errors are reported.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Install Perl or disable formatting via 'enableFormat': false.","message":"Formatting only works if Perl is installed on the system, as it uses pgFormatter which depends on Perl.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'0.3.0':32 'add':12 'check':14,36 'configur':53 'current':27 'databas':42 'detect':18 'develop':80 'diagnost':34 'editor':60 'error':17 'file':44 'format':46 'infrequ':73 'insid':23 'javascript':87 'languag':8,63 'liter':26 'maintain':70 'perl':50 'pgformatt':48 'plugin':5,10,65,68 'postgresql':29 'provid':33 'queri':21 'raw':82 'requir':49 'schema':43 'server':64 'servic':9 'special':77 'sql':2,20,83,89 'string':84 'suppli':41 'support':28,66 'syntax':16 'tag':3,24 'templat':4,25,90 'tool':78 'tsconfig.json':55 'type':13,35 'typescript':1,7,62,86,88 'updat':72 'use':81 'user':40 'user-suppli':39 'version':31 'via':47 'work':57 'written':22","created_at":"2026-06-05T17:02:54.263596+00:00","updated_at":"2026-06-05T17:02:54.263596+00:00","problems":[{"fix":"Run 'npm install --save-dev typescript-sql-tagged-template-plugin' and ensure 'name' matches exactly.","cause":"The plugin is not installed or not referenced correctly in tsconfig.json.","error":"Plugin 'typescript-sql-tagged-template-plugin' is not found"},{"fix":"Install and import an sql tag library like 'sql-tagged-template-literal' or define your own.","cause":"The sql tag function needs to be imported from a third-party library; this plugin does not provide it.","error":"Cannot find name 'sql'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/frigus02/typescript-sql-tagged-template-plugin","github":"https://github.com/frigus02/typescript-sql-tagged-template-plugin","docs":null,"changelog":null,"pypi":null,"npm":"typescript-sql-tagged-template-plugin","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}