pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: https://zed.dev/docs/ai/../languages/../languages/../languages/../development/../languages/sql.html

link rel="stylesheet" href="../css/variables.css">
Download

SQL

SQL files are handled by the SQL Extension.

Formatting

Zed supports auto-formatting SQL using external tools like sql-formatter.

  1. Install sql-formatter:
npm install -g sql-formatter
  1. Ensure sql-formatter is available in your path and check the version:
which sql-formatter
sql-formatter --version
  1. Configure formatting in Settings (cmd-,|ctrl-,) under Languages > SQL, or add to your settings file:
  "languages": {
    "SQL": {
      "formatter": {
        "external": {
          "command": "sql-formatter",
          "arguments": ["--language", "mysql"]
        }
      }
    }
  },

Substitute your preferred [SQL Dialect] for mysql above (duckdb, hive, mariadb, postgresql, redshift, snowflake, sqlite, spark, etc).

You can add this to Zed project settings (.zed/settings.json) or via your Zed user settings (~/.config/zed/settings.json).

Advanced Formatting

Sql-formatter also allows more precise control by providing sql-formatter configuration options. To provide these, create a .sql-formatter.json file in your project:

{
  "language": "postgresql",
  "tabWidth": 2,
  "keywordCase": "upper",
  "linesBetweenQueries": 2
}

When using a .sql-formatter.json file you can use a simplified Zed settings configuration:

{
  "languages": {
    "SQL": {
      "formatter": {
        "external": {
          "command": "sql-formatter"
        }
      }
    }
  }
}
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy