Crates.io | psqlgen |
lib.rs | psqlgen |
version | 0.1.2 |
source | src |
created_at | 2023-07-17 16:43:00.619597 |
updated_at | 2023-07-19 00:06:50.256331 |
description | PostgreSQL Query generation from migrations. |
homepage | |
repository | https://github.com/franklinblanco/psqlgen |
max_upload_size | |
id | 918660 |
size | 22,990 |
by Franklin Blanco
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.
-Input directory -Output directory
cargo install psqlgen
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