https://github.com/a7bari/pl-sql-api-generator
A Go tool that reads the DDL of DB tables and generate PL/SQL procedures for get, update, and insert operations
https://github.com/a7bari/pl-sql-api-generator
Last synced: 6 months ago
JSON representation
A Go tool that reads the DDL of DB tables and generate PL/SQL procedures for get, update, and insert operations
- Host: GitHub
- URL: https://github.com/a7bari/pl-sql-api-generator
- Owner: A7bari
- License: mit
- Created: 2024-08-10T00:25:57.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-11T12:53:05.000Z (about 1 year ago)
- Last Synced: 2025-03-24T01:01:31.266Z (7 months ago)
- Language: Go
- Size: 10.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# PL/SQL Package Generator in Go
This project is a Go-based tool designed to **automate the generation of PL/SQL package** containing CRUD (Create, Read, Update, Delete) operations for tables defined in DDL (Data Definition Language) scripts. The tool consists of two main components: a **parser** and a **generator**.
## Overview
This tool automates the creation of PL/SQL package specifications for tables defined in DDL scripts. The tool consists of two main parts:
- ### Parser:
Reads the DDL of tables and extracts the tables along with their columns.
- ### Generator:
Generates a PL/SQL package for each table, containing procedures for insert, update, and get operations.
The tool is particularly useful for developers working in environments where PL/SQL is heavily used, as it simplifies and automates the repetitive task of creating standard CRUD procedures for database tables.
## Features
- DDL Parsing: Automatically parse DDL scripts to identify tables and their associated columns, the parser uses the State pattern to handle different states of the parsing process.
```go
// StateFn represents a function that processes input and returns the next state.
type StateFn func(*Parser) StateFn
```- Package Generation: Generate consistent PL/SQL package specifications/body for each table, including basic CRUD operations.
- Extensible Design: Can be easily extended to include more complex procedures or additional database operations.