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.
npm install typescript-sql-tagged-template-pluginNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows installation, tsconfig configuration, and a basic SQL tagged template usage that the plugin analyzes.
Disable the 'TypeScript > Tsserver: Use Separate Syntax Server' setting in VS Code.
Ensure you are using PostgreSQL syntax; for other databases, find alternative plugins.
Generate a database schema JSON file using the provided script (scripts/schema/index.js) and configure 'schemaFile' in tsconfig.
Install Perl or disable formatting via 'enableFormat': false.
Run 'npm install --save-dev typescript-sql-tagged-template-plugin' and ensure 'name' matches exactly.
Install and import an sql tag library like 'sql-tagged-template-literal' or define your own.