[Haskell-cafe] Inverse of HaskellDB

Jonathan Geddes geddes.jonathan at gmail.com
Sat Sep 25 19:31:55 EDT 2010


>Have you given any thought as to how you want to approach versioning?

After giving this some more thought, I realized:
1) One of the "best practices" (even though I despise the term) of
versioning schema is to include a script with the code which checks
for each change to the tables, and makes the change if it is needed
[1]. Each time you check out new code, you run the script to ensure
that the code you are working with matches the tables you are working
with.
2) A system that generates tables from Haskell types could also be
made to check if a given table faithfully represents a given Haskell
record type. It could then make any changes to the table so that it
_does_ faithfully represent the record type.
3) In this way, your Haskell records ARE your table update script,
just (like most Haskell code) incredibly terse. Your usual code
repository will track when and by whom changes are made to the record.

Of course, there are some issues with this, but I think it could be
made to work well.

>Hibernate does this, more or less, for Java classes.  That might be a
>good place to look for ideas.

Good point. I'll start there.

[1] http://www.codeproject.com/KB/database/DatabaseSchemaVersioning.aspx

--Jonathan

On Sat, Sep 25, 2010 at 3:45 PM, Rogan Creswick <creswick at gmail.com> wrote:
> On Sat, Sep 25, 2010 at 12:31 PM, Jonathan Geddes
> <geddes.jonathan at gmail.com> wrote:
>>
>> Does such a thing exist? If not, would you find it useful? I may take
>> this up as a side project if it does not already exist and others
>> would find it useful.
>>
>
> I've been looking for something along these lines too.
>
> Hibernate does this, more or less, for Java classes.  That might be a
> good place to look for ideas.
>
> --Rogan
>
>> Thanks,
>>
>> --Jonathan
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>


More information about the Haskell-Cafe mailing list