Gentoo Archives: gentoo-server

From: Bishop Bettini <php@××××××××.com>
To: gentoo-server@l.g.o
Subject: [gentoo-server] Request for Comments: dbdeploy eclass
Date: Fri, 16 Apr 2010 22:03:12
Message-Id: 20100416174452.fx3lop1b4k0csk8o@mail.ideacode.com
1 dbdeploy is a strategy for migrating a database from earlier to later
2 versions through the use of delta SQL files. Originally implemented
3 for Java, with a later evolution in Phing, PEAR, and .NET, the
4 strategy is documented at:
5 http://dbdeploy.com/documentation/
6
7 Each delta has a change number, and when that numbered changed is
8 applied to a given DB, the number is remembered in a changelog table.
9 Thus, a change will be applied only once, to a given database, and the
10 history of applied changes can be easily queried within the database
11 itself.
12
13 Lots of applications have SQL that should be applied to the database.
14 Those that do not already have a SQL migration practice inherent in
15 their architecture often rely on ad-hoc means to upgrade a database.
16 This leads wheels being reinvented, despite an established practice
17 being available. A dbdeploy eclass would help these applications
18 standardize on a means to apply SQL changes should their deployment
19 environment not already provide one.
20
21 We have developed a dbdeploy eclass to allow ebuilds to apply database changes
22 from within the ebuild. Our prototype implementation has concrete support for
23 generic/vanilla SQL (known to work on MySQL and PostgreSQL), but the
24 design allows for plugging in specific DBMS syntax.
25
26 Our initial implementation is attached.
27
28 As you can see, the eclass is not concerned with the mechanics of
29 reading from or writing to the database. That is package-dependent
30 and is left to the package to implement. The eclass provides only the
31 SQL necessary to list the changes applied so far and the SQL to apply
32 changes from a given directory, as well as support for undoing failed
33 changes.
34
35 Is this something the Gentoo community would be interested in having
36 available?
37
38 thoughts?
39
40 Thanks!
41 bishop
42
43 --
44 Bishop Bettini
45 ideacode, Inc.
46 (main) +1 919 341 5170 / (fax) +1 919 521 4100
47
48 Visit us on the web at:
49 ideacode.com Professional software research and development
50 reviewmysoftware.com Improve sales! Review your software before you release
51 bytejar.com Solutions to those annoying development problems

Attachments

File name MIME type
dbdeploy.eclass application/octet-stream

Replies

Subject Author
[gentoo-server] Re: Request for Comments: dbdeploy eclass Kerin Millar <kerframil@×××××.com>