New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ovotech/prettier-plugin-pgsql

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ovotech/prettier-plugin-pgsql

Prettier plugin for formatting postgres SQL

  • 0.8.11
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3.3K
decreased by-44.4%
Maintainers
0
Weekly downloads
 
Created
Source

Postgres sql prettier plugin

Plugin for formatting postgres SQL

Installation

yarn add --dev @ovotech/prettier-plugin-pgsql

Which should allow you to format sql files

prettier --write **/*.sql

SQL Template String

Since potygen is built to work with sql template strings, as they are much more ergonomic in typescript, the native prettier plugins are still not enough. Prettier itself does not support custom sql template strings, outside its predifined ones - this issue is tracked here: https://github.com/prettier/prettier/issues/4424

To get around this I've created a very simple patch to prettier code and will publish a patched version at @potygen/prettier for the time being, until a proper solution is found.

To set it up you need to force yarn (or npm) to load "prettier" from another repo. The code is the same, just adds "sql" as an additional template string that is then able to be extended by the plugin.

{
  "devDependencies": {
    "prettier": "npm:@potygen/prettier@^2.8.1"
  }
}

FAQs

Package last updated on 05 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc