[Haskell-cafe] ANN: Groundhog-inspector, a tool for generating datatypes from database

info at rotnetix.com info at rotnetix.com
Sat Dec 27 05:43:48 UTC 2014


Looks like a great idea.  I tried it on one of my databases and got the 
following error:

** Exception: mkUniqueKeyPhantomName: (Just "public","itrd_test")uniques 
list must be not empty

Do you know what that might mean?

On Friday, December 5, 2014 4:07:34 AM UTC+11, Boris Lykah wrote:
>
> Hello everyone,
>
> I am pleased to announce groundhog-inspector. It analyzes database schema 
> and creates corresponding datatypes and mapping configuration for 
> Groundhog. It works with PostgreSQL, MySQL, and Sqlite. Composite keys, 
> constraints, references across schemas, and other details of schema are 
> reflected in the output. Groundhog-inspector can be used as a library and 
> provides a standalone tool for simple scenarios.
>
> Here is an example of the standalone tool usage. JSON mapping in the 
> output was manually converted to YAML for brevity.
>
> $ sqlite3 dbfile "CREATE TABLE mytable (id INTEGER PRIMARY KEY NOT NULL, 
> str VARCHAR NOT NULL, ref INTEGER references mytable)"
>
> $ groundhog_inspector sqlite dbfile
>
> data Mytable
>     = Mytable {mytableStr :: String,
>                mytableRef :: (Maybe (AutoKey Mytable))}
>
> - entity: "Mytable"
>   dbName: "mytable"
>   constructors: 
>     - name: "Mytable"
>       fields: 
>         - name: "mytableStr"
>           dbName: "str"
>         - name: "mytableRef"
>           dbName: "ref"
>
> * [Hackage] (http://hackage.haskell.org/package/groundhog-inspector)
> * [GitHub] (
> https://github.com/lykahb/groundhog/tree/master/groundhog-inspector/examples
> )
>
> I would be happy to answer the questions. Enjoy!
>
> Regards,
> Boris Lykah
>  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20141226/ba7878d9/attachment-0002.html>


More information about the Haskell-Cafe mailing list