<div dir="ltr"><div><div>Hello everyone,</div><div><br></div><div>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.</div><div><br></div><div>Here is an example of the standalone tool usage. JSON mapping in the output was manually converted to YAML for brevity.</div><div><br></div><div>$ sqlite3 dbfile "CREATE TABLE mytable (id INTEGER PRIMARY KEY NOT NULL, str VARCHAR NOT NULL, ref INTEGER references mytable)"</div><div><br></div><div>$ groundhog_inspector sqlite dbfile</div><div><br></div><div>data Mytable</div><div>    = Mytable {mytableStr :: String,</div><div>               mytableRef :: (Maybe (AutoKey Mytable))}</div><div><br></div><div>- entity: "Mytable"</div><div>  dbName: "mytable"</div><div>  constructors: </div><div>    - name: "Mytable"</div><div>      fields: </div><div>        - name: "mytableStr"</div><div>          dbName: "str"</div><div>        - name: "mytableRef"</div><div>          dbName: "ref"</div><div><br></div><div>* [Hackage] (<a href="http://hackage.haskell.org/package/groundhog-inspector">http://hackage.haskell.org/package/groundhog-inspector</a>)</div><div>* [GitHub] (<a href="https://github.com/lykahb/groundhog/tree/master/groundhog-inspector/examples">https://github.com/lykahb/groundhog/tree/master/groundhog-inspector/examples</a>)</div><div><br></div><div>I would be happy to answer the questions. Enjoy!</div><div><br></div><div>Regards,</div><div>Boris Lykah</div></div>
</div>