• Stars
    star
    5
  • Rank 2,861,937 (Top 57 %)
  • Language
    Perl
  • License
    GNU General Publi...
  • Created over 7 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SQL parser to convert different SQL flavor to PostgreSQL compatible SQL

sql2pg

/!\ WARNING /!\

This project is still a work in progress, SQL grammar are big and complex. If you encounter some statements that are not handled, please report an issue with a self contained case and a link to the grammar reference.

Overview

sql2pg is a parser that converts various flavor of SQL to PostgreSQL compatible SQL.

It'll convert automatically most of specific keywords (CONNECT BY, (+)...), type, functions and so on.

Things that can't be automatically converted will be exported as SQL comments after its problematic query.

Dependencies

sql2pg requires Marpa::R2, at least version 2.076000.

Usage

For Oracle SQL:

plsql2pg.pl queries.sql > rewritten_queries.sql

For SQL Server SQL:

tsql2pg.pl queries.sql > rewritten_queries.sql