Show HN: PgRebase, codebase management for Postgres
I think this is interesting and starting down a better path than migrations; there are other tools which similarly keep schema files organized in a structural way rather than as a timeline... a much superior approach.<p>Having said that, the dependency management here will have to get better before I could consider it.<p><i>You can specify dependencies for files using require statement, provided those files are of the same kind. That is, function files can specify dependencies on other function files, type files can define dependencies on other type files, etc.</i><p>This alone is a show stopper for me.<p>Say I have a table (ignore formatting and other formalities):<p>CREATE TABLE test_table (id uuid primary key, test_val text, test_val_num numeric);<p>Now I need a PL&#x2F;pgSQL function as so....<p>CREATE FUNCTION testfunc() RETURNS VOID AS
$BODY$ DECLARE myTestRec test_table; BEGIN [do stuff] END; $BODY$<p>My function declares the myTestRec variable to be of type test_table which means for the create function statement to work, the test_table table must exist first.  But I cannot, according to the documentation, express or depend that the dependency will be recognized and enforced.  Lack of more fluid dependency management would be a show stopper for me.<p>I like that this tool is implemented in Go; the tool that I use which has this sort of approach is Sqitch (<a href="http:&#x2F;&#x2F;sqitch.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;sqitch.org&#x2F;</a>) and I hate the perl dependencies that need to be fulfilled to get it to install.  But couldn&#x27;t leave it for something like this until a greater number of scenarios are supported.<p>[Edit for clarity]