[Scons-users] database builder

Philipp Kraus philipp.kraus at flashpixx.de
Sat Apr 13 05:34:26 EDT 2013


Hi,

I'm searching for database support in Scons something like databse installation and updating. I'm often work with database and do the installation with SQL scripts,
but the client is compiled and installed with Scons, so can be this an idea for Scons? Do you think this is a good & meningful feature?
At the moment I run env.Command with the database command-line client, but the updating process can not work / can only work with deleting & creating the database.

I think a feature like this
env.CreateDatabase("localhost:5432", databse="testdb", user"=myself", password="1234", type="postgresql", source="database.sql.scons")

should be nice, also an env.UpdateDatabase which updates the database without deleting tables, it creates only alter statements and run these statements for the update process.
Scons can handle this calls in an transaction for atomic calls and uses Pythons database packages. The database script should be more than a plain text file, so Scons can
check the database and create individual statements during the update process.

My idea is, that the Scons database.sql.scons file is a XML files which descriptes tables, indicies, references datatypes (validation via XSD)....
On the createdatabase Scons transform this data with XSLT into SQL or walk through the XML tree and creates on-fly the statements and send it over Python Database API
The update is more difficult, because I must create a diff between installed tables and new table definition. I think a post- / preprocessing should be also in it, so the user
can run some codes before / after the update for modifying datasets.

Hope for some comments :-)
Have a nice weekend

Phil


More information about the Scons-users mailing list