Project

dbuddy

0.0
No commit activity in last 3 years
No release in over 3 years
A small script to watch over bunches of raw SQL files and load them on changes. Or just load a bunch at once.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

DBuddy

Have stored procedures or view definitions in your application? Wouldn’t it be great if you could keep those with the rest of your code?

DBuddy is a small script that does two things to streamline this process:

  1. Loads all of the SQL files matching one or more globs
  2. Watches over those files and reloads them on changes

Usage

Loading:


  dbuddy db/views/*.sql db/procedures/*.sql

Watching:


  dbuddy --watch db/views/*.sql db/procedures/*.sql
  dbuddy -w db/views/*.sql db/procedures/*.sql

From code (e.g. rake task)


  DBuddy.run(ActiveRecord::Base.connection, Dir.glob("db/views/*.sql") + Dir.glob("db/procedures/*.sql"))

TODOs

  • Right now it assumes it’s being run in the root of a Rails project and loads config/environment.rb. This could be improved, but right now I don’t have a use case.