Polyglot SQL API Documentation - v0.1.0
    Preparing search index...

    Function format

    • Format/pretty-print SQL.

      Parameters

      • sql: string

        The SQL string to format

      • dialect: Dialect = Dialect.Generic

        The dialect to use

      Returns TranspileResult

      The formatted SQL

      const result = format("SELECT a,b FROM t WHERE x=1", Dialect.PostgreSQL);
      // result.sql[0] = "SELECT\n a,\n b\nFROM t\nWHERE x = 1"