This repository includes a joined query generator based on typefull relational algebra, and mapping tools between SQL values list and Haskell record type.
233
stars
36
forks
source link
use column_type instead of data_type for determining MySQL -> Haskell… #42
Which might be bad because you have to enumerate every column_type, but at least it lets you specify my use case of turning tinyint(1) into Bool. It might be okay to carefully select the type for every possible variation you use too; I'm not sure.
This is meant to be a prototype showing how we can use column_type
instead of data_type to determine what type a particular column should
have. This allows mappings like tinyint(1) -> Bool without mapping
tinyint(3) to Bool, for example.
Probably this implementation is bad because it will break existing code,
so a more clean transition path should probably be investigated.
… type mapping
This is not meant to be a serious pull request. It is meant to show how could implement #41. With these changes you can use a type map like:
Which might be bad because you have to enumerate every column_type, but at least it lets you specify my use case of turning tinyint(1) into Bool. It might be okay to carefully select the type for every possible variation you use too; I'm not sure.
This is meant to be a prototype showing how we can use column_type instead of data_type to determine what type a particular column should have. This allows mappings like tinyint(1) -> Bool without mapping tinyint(3) to Bool, for example.
Probably this implementation is bad because it will break existing code, so a more clean transition path should probably be investigated.