norm2782/snaplet-hdbc — Issue #5: Requires HDBC-2.3.
Author: rodneythellama
Created: 2011-11-04 20:03:20+00:00
State: open

Hi, I was getting a build problem when building snaplet-hdbc 0.6.3 on debian unstable with cabal. Debian has HDBC-2.2.6.1. After I installed HDBC-2.3.1.0 with cabal, the build worked. I suppose you could either change the code or change the dependency in the cabal file.

```
rodney@sid:/devel/snap/snaplet-hdbc % ghc-pkg list
/var/lib/ghc/package.conf.d
Cabal-1.10.2.0
HDBC-2.2.6.1
HDBC-postgresql-2.2.3.1
HDBC-sqlite3-2.3.1.0
X11-1.5.0.0
X11-xft-0.3
array-0.3.0.2
base-4.3.1.0
bin-package-db-0.0.0.0
bytestring-0.9.1.10
containers-0.4.0.0
convertible-1.0.11.0
deepseq-1.1.0.2
directory-1.1.0.0
extensible-exceptions-0.1.1.2
filepath-1.2.0.0
ghc-7.0.4
ghc-binary-0.5.0.2
ghc-prim-0.2.0.0
haskell2010-1.0.0.0
haskell98-1.1.0.1
haskelldb-2.1.1
haskelldb-hdbc-2.1.0
haskelldb-hdbc-postgresql-2.1.0
haskelldb-hdbc-sqlite3-2.1.0
hpc-0.5.0.6
hsql-1.8.1
hsql-mysql-1.8.1
hsql-sqlite3-1.7.1
integer-gmp-0.2.0.3
mtl-2.0.1.0
old-locale-1.0.0.2
old-time-1.0.0.6
parsec-2.1.0.1
pretty-1.0.1.2
process-1.0.1.5
random-1.0.0.3
rts-1.0
syb-0.3
template-haskell-2.5.0.0
text-0.11.1.5
time-1.2.0.3
transformers-0.2.2.0
unix-2.4.2.0
utf8-string-0.3.6
xmonad-0.9.2
xmonad-contrib-0.9.2
/home/rodney/.ghc/x86_64-linux-7.0.4/package.conf.d
Crypto-4.2.4
HDBC-mysql-0.6.5.0
HUnit-1.2.4.2
MonadCatchIO-transformers-0.2.2.3
PSQueue-1.1
QuickCheck-2.4.1.1
aeson-native-0.3.3.1
attoparsec-0.9.1.2
attoparsec-enumerator-0.2.0.4
attoparsec-text-0.8.5.1
base-unicode-symbols-0.2.2.2
base16-bytestring-0.1.1.2
base64-bytestring-0.1.0.3
binary-0.5.0.2
blaze-builder-0.3.0.1
blaze-builder-enumerator-0.2.0.3
blaze-html-0.4.2.0
blaze-textual-native-0.2.1
bytestring-mmap-0.2.2
bytestring-nums-0.3.5
case-insensitive-0.3.0.1
cereal-0.3.4.0
clientsession-0.7.3.3
comonad-1.1.1.1
comonad-transformers-2.0.2
configurator-0.1.0.0
contravariant-0.1.3
crypto-api-0.8
crypto-pubkey-types-0.1.0
cryptocipher-0.3.0
cryptohash-0.7.4
data-default-0.3.0
data-lens-2.0.2
data-lens-template-2.1.2
directory-tree-0.10.0
distributive-0.2.0.1
dlist-0.5
entropy-0.2.1
enumerator-0.4.15
hashable-1.1.2.2
haskelldb-hdbc-mysql-0.1.1
heist-0.6.0.1
largeword-1.0.1
logict-0.5.0
monad-control-0.2.0.3
murmur-hash-0.1.0.4
mwc-random-0.10.0.1
network-2.3.0.7
parsec-3.1.2
primitive-0.4.0.1
pwstore-fast-2.2
regex-base-0.93.2
regex-posix-0.94.4
resource-pool-0.2.0.2
safe-0.3
semigroupoids-1.2.6
semigroups-0.8
skein-0.1.0.3
snap-0.6.0.2
snap-core-0.6.0.1
snap-server-0.6.0.1
stm-2.2.0.1
tagged-0.2.3.1
unix-compat-0.3
unordered-containers-0.1.4.3
vector-0.9
vector-algorithms-0.5.3
xmlhtml-0.1.5.2
zlib-0.5.3.1
zlib-bindings-0.0.1
zlib-enum-0.2.1
rodney@sid:/devel/snap/snaplet-hdbc % runghc Setup.hs configure --user
Configuring snaplet-hdbc-0.6.3...
rodney@sid:/devel/snap/snaplet-hdbc % runghc Setup.hs build
Preprocessing library snaplet-hdbc-0.6.3...
Building snaplet-hdbc-0.6.3...
[1 of 3] Compiling Snap.Snaplet.Hdbc.Types ( src/Snap/Snaplet/Hdbc/Types.hs, dist/build/Snap/Snaplet/Hdbc/Types.o )
[2 of 3] Compiling Snap.Snaplet.Hdbc ( src/Snap/Snaplet/Hdbc.hs, dist/build/Snap/Snaplet/Hdbc.o )
[3 of 3] Compiling Snap.Snaplet.Auth.Backends.Hdbc ( src/Snap/Snaplet/Auth/Backends/Hdbc.hs, dist/build/Snap/Snaplet/Auth/Backends/Hdbc.o )

src/Snap/Snaplet/Auth/Backends/Hdbc.hs:196:38:
No instance for (Convertible Text SqlValue)
arising from a use of `toSql'
Possible fix:
add an instance declaration for (Convertible Text SqlValue)
In the second argument of `($)', namely `toSql uid'
In the expression: Right $ toSql uid
In an equation for `safeConvert':
safeConvert (UserId uid) = Right $ toSql uid

src/Snap/Snaplet/Auth/Backends/Hdbc.hs:257:31:
No instance for (Convertible SqlValue Text)
arising from a use of `rdSql'
Possible fix:
add an instance declaration for (Convertible SqlValue Text)
In the `userRememberToken' field of a record
In the expression:
AuthUser
{userId = rdSql UserId colId, userLogin = fromSql $ colLU colLogin,
userPassword = rdSql Encrypted colPassword,
userActivatedAt = rdSql id colActivatedAt,
userSuspendedAt = rdSql id colSuspendedAt,
userRememberToken = rdSql id colRememberToken,
userLoginCount = rdInt colLoginCount,
userFailedLoginCount = rdInt colFailedLoginCount,
userLockedOutUntil = rdSql id colLockedOutUntil,
userCurrentLoginAt = rdSql id colCurrentLoginAt,
userLastLoginAt = rdSql id colLastLoginAt,
userCurrentLoginIp = rdSql id colCurrentLoginIp,
userLastLoginIp = rdSql id colLastLoginIp,
userCreatedAt = rdSql id colCreatedAt,
userUpdatedAt = rdSql id colUpdatedAt, userRoles = [],
userMeta = HM.empty}
In the expression:
let
colLU col' = mp DM.! col' tbl
rdSql con col'
= case colLU col' of {
SqlNull -> ...
x -> ... }
rdInt col
= case colLU col of {
SqlNull -> ...
x -> ... }
in
AuthUser
{userId = rdSql UserId colId, userLogin = fromSql $ colLU colLogin,
userPassword = rdSql Encrypted colPassword,
userActivatedAt = rdSql id colActivatedAt,
userSuspendedAt = rdSql id colSuspendedAt,
userRememberToken = rdSql id colRememberToken,
userLoginCount = rdInt colLoginCount,
userFailedLoginCount = rdInt colFailedLoginCount,
userLockedOutUntil = rdSql id colLockedOutUntil,
userCurrentLoginAt = rdSql id colCurrentLoginAt,
userLastLoginAt = rdSql id colLastLoginAt,
userCurrentLoginIp = rdSql id colCurrentLoginIp,
userLastLoginIp = rdSql id colLastLoginIp,
userCreatedAt = rdSql id colCreatedAt,
userUpdatedAt = rdSql id colUpdatedAt, userRoles = [],
userMeta = HM.empty}
```

Cheers,

Rodney