recursively searches a directory for sql files and runs them in a prioritized way (filename prefixes)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
process
.gitignore
config.example.json
go.mod
go.sum
main.go
readme.md

readme.md

Usage

sqlrun -dir "" -p comma,separated,prefixes

Description

Recursively search "dir" for sql files and run them against the database pointed to by the connection string in config.json

config.json

{ "connectionString": "connection string" }

Notes

For instance, if you wanted to make sure all table definition files run first, specify -p tbl Multiple priorities can be set, otherwise it will order them by how it finds them in the directory structure.

Enjoy!