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

    Function transpile

    • Transpile SQL from one dialect to another.

      Parameters

      • sql: string

        The SQL string to transpile

      • read: Dialect

        Source dialect to parse the SQL with

      • write: Dialect

        Target dialect to generate SQL for

      Returns TranspileResult

      The transpiled SQL statements

      const result = transpile(
      "SELECT IFNULL(a, b)",
      Dialect.MySQL,
      Dialect.PostgreSQL,
      );
      // result.sql[0] = "SELECT COALESCE(a, b)"