krdlab / trial-hrr-mysql

Trial project for Haskell Relational Record (HRR) and MySQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trial Project for Haskell Relational Record (HRR) and MySQL

はじめに

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

  • 実行環境
  • VM 環境
    • CentOS 6.6
    • MySQL >=5.6.24

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

## VM の起動
$ cd mysql-server && vagrant up
...
[sudo] password for <username>:         # 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 を抑制すれば良いだけになってた.

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

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

参考情報

About

Trial project for Haskell Relational Record (HRR) and MySQL


Languages

Language:Haskell 91.1%Language:Ruby 5.7%Language:Shell 3.1%