{"library":"prettier-plugin-sql","title":"prettier-plugin-sql","description":"Prettier plugin for formatting SQL files and SQL-in-JS. Wraps sql-formatter and node-sql-parser to support 20+ dialects including BigQuery, PostgreSQL, MySQL, ClickHouse. Requires Prettier 3.0.3+ and Node 14.18+. Version 0.20.0 adds ClickHouse support. Plugin is under active development but stable for basic usage. Differentiator: integrates with prettier-plugin-embed for embedded SQL in tagged templates.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install prettier-plugin-sql"],"cli":{"name":"prettier","version":null}},"imports":["Prettier plugin loaded via plugins config in .prettierrc: { \"plugins\": [\"prettier-plugin-sql\"] }","import type { SqlBaseOptions } from 'prettier-plugin-sql'","import type { PrettierPluginEmbedOptions } from 'prettier-plugin-embed'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// Install: npm i -D prettier prettier-plugin-sql\n// .prettierrc\n{\n  \"plugins\": [\"prettier-plugin-sql\"],\n  \"language\": \"postgresql\",\n  \"keywordCase\": \"upper\"\n}\n\n// Run: npx prettier --write db.sql\n// Before (db.sql):\n//   sELect  first_name,    species froM\n//    animals\n//          WhERE\n//   id = 1\n//\n// After:\n//   SELECT\n//     first_name,\n//     species\n//   FROM\n//     animals\n//   WHERE\n//     id = 1","lang":"typescript","description":"Basic setup: add plugin to .prettierrc, configure PostgreSQL dialect and uppercase keywords, format a SQL file.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}