1.1.1 • Published 8 months ago

plsql-to-ast v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

plsql-to-ast: Parse PL/SQL Code to JSON

plsql-to-ast is a powerful tool for parsing complex PL/SQL code and extracting its Abstract Syntax Tree (AST) into a structured JSON format. It's designed to handle various PL/SQL code constructs, including stored procedures, triggers, and functions, making it a versatile solution for analyzing and manipulating PL/SQL codebases.

Features

  • Parse PL/SQL code and generate structured JSON representation of the AST.
  • Handle complex PL/SQL constructs like loops, conditionals, function calls, and more.
  • Option to display errors in the console.
  • Easily integrated into projects through npm installation or command-line usage.

Installation

To install the plsql-to-ast module via npm, use the following command:

npm install plsql-to-ast

Command-Line Usage

plsql-to-ast can be used via the command line to generate JSON output for a provided PL/SQL file. The following options are available:

# Provide a PL/SQL file to generate abstraction (required)
node dist/plsql-to-ast-script.js --sql-file=path/to/your/sql/file.sql

Options:

-f, --sql-file: Provide a PL/SQL file to generate abstraction (required).
-e, --show-errors: Display errors in the console (boolean, default: false).
--help: Display help information.

Module Usage

You can also use plsql-to-ast as a module in your TypeScript project:

import { getASTAsJSON } from "plsql-to-ast";

const query = 'SELECT * FROM \`employees\`;';
const jsonOutput = getASTAsJSON(query);

Examples

Contributions and Feedback

Contributions to the project are welcome! If you encounter any issues or have suggestions for improvements, feel free to open an issue.

Thanks

Thank you for considering plsql-to-ast for your PL/SQL parsing needs. We hope this tool proves valuable in your development and analysis workflows. Happy coding!

1.1.1

8 months ago

1.1.0

8 months ago

1.0.0

9 months ago