Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/krdlab/trial-hrr-mysql

Trial project for Haskell Relational Record (HRR) and MySQL
https://github.com/krdlab/trial-hrr-mysql

Last synced: 9 days ago
JSON representation

Trial project for Haskell Relational Record (HRR) and MySQL

Awesome Lists containing this project

README

        

# Trial Project for Haskell Relational Record (HRR) and MySQL

## はじめに

HRR と MySQL の組み合わせで色々と実験するためのプロジェクト.

* 実行環境
* GHC >=7.8.3
* cabal-install >=1.20.0.4
* vagrant >=1.7.2
* 以下のプラグインをインストール済み
* [vagrant-vbguest](https://github.com/dotless-de/vagrant-vbguest)
* [vagrant-hostsupdater](https://github.com/cogitatio/vagrant-hostsupdater)
* virtualbox >=4.3.26
* VM 環境
* CentOS 6.6
* MySQL >=5.6.24

## VM 起動 -> ビルド -> examples 実行

```sh
## VM の起動
$ cd mysql-server && vagrant up
...
[sudo] password for : # required by vagrant-hostsupdater
...
$ cd -

$ git clone https://github.com/khibino/haskell-relational-record.git hrr
$ git clone https://github.com/bos/hdbc-mysql.git

$ cd examples
$ cabal sandbox init
$ cabal sandbox add-source \
../hrr/HDBC-session \
../hrr/names-th \
../hrr/persistable-record \
../hrr/relational-query \
../hrr/relational-query-HDBC \
../hrr/relational-schemas \
../hrr/sql-words \
../hdbc-mysql
$ cabal install
$ .cabal-sandbox/bin/hrr-examples
```

## MySQL 固有の事項

確認した範囲に限れば,スキーマ/テーブル名の normalize を抑制すれば良いだけになってた.

```haskell
import Database.Relational.Query (Config (..), defaultConfig)
config :: Config
config = defaultConfig { normalizedTableName = False }
```

あとはこの `config` を `defineTableFromDB'` といった `Config` を受け取る関数に渡せばよい.

## 参考情報

*
*
*