3 releases

0.1.2 Jul 19, 2023
0.1.1 Jul 17, 2023
0.1.0 Jul 17, 2023

#2247 in Database interfaces

25 downloads per month

MIT license

14KB
229 lines

QueryGen

by Franklin Blanco

ONLY FOR POSTGRESQL At the moment

Goal

Feed this CLI an input of valid SQL migrations, and a directory where the output SQL Files will be generated, for [insert update delete get] SQL queries will be generated.

How?

-Input directory -Output directory

Install

cargo install psqlgen

Usage

Suppose we have a directory migrations that contains migration1.sql migration2.sql And we want to generate our SQL queries in sql migration1 migration2 We then run psqlgen -i migrations/ -o sql/ Assuming valid input, This will create: sql migration1 insert.sql update.sql delete.sql get.sql migration2 insert.sql update.sql delete.sql get.sql

Dependencies

~3MB
~58K SLoC