soostone / cassy Goto Github PK
View Code? Open in Web Editor NEWHigh level Cassandra bindings for Haskell
License: BSD 3-Clause "New" or "Revised" License
High level Cassandra bindings for Haskell
License: BSD 3-Clause "New" or "Revised" License
instance CasType Bool where
encodeCas i = runPut $ putWord8 (if i then 1 else 0)
decodeCas i = 1 == runGet getWord8 i
perhaps there's a better way, I'm not sure.
Hello
I cannot connect to Cassandra by your usage.
The code is below.
I got an error message.
If you have a better usage.
Please share...
===error===============================
No instance for (B.MonadCassandra IO)
arising from a use of `B.insert'
Possible fix: add an instance declaration for (B.MonadCassandra IO)
===code===============================
import qualified Database.Cassandra.Basic as B
import qualified Database.Cassandra.Types as T
import qualified Data.ByteString.Char8 as U
import qualified Data.ByteString.Lazy.Internal as P
defServer = ("...",9160)
defServers = [defServer]
key = P.Chunk (U.pack "key1") P.Empty
myCol = P.Chunk (U.pack "col1") P.Empty
myVal = P.Chunk (U.pack "val1") P.Empty
test :: IO ()
test = do
putStrLn "test"
pool <- B.createCassandraPool defServers 3 300 3 "DEMO"
B.insert "SampleColumnFamily" key B.QUORUM [B.col myCol myVal]
Building cassy-0.5.1.0...
Preprocessing library cassy-0.5.1.0...
[1 of 6] Compiling Database.Cassandra.Pool ( src/Database/Cassandra/Pool.hs, dist/build/Database/Cassandra/Pool.o )
[2 of 6] Compiling Database.Cassandra.Pack ( src/Database/Cassandra/Pack.hs, dist/build/Database/Cassandra/Pack.o )
[3 of 6] Compiling Database.Cassandra.Types ( src/Database/Cassandra/Types.hs, dist/build/Database/Cassandra/Types.o )
[4 of 6] Compiling Database.Cassandra.Basic ( src/Database/Cassandra/Basic.hs, dist/build/Database/Cassandra/Basic.o )
src/Database/Cassandra/Basic.hs:404:36:
Couldn't match expected type `lifted-base-0.2.1.0:Control.Exception.Lifted.Handler
m Bool'
with actual type `MCIO.Handler m0 Bool'
In the expression: casRetryH
In the second argument of `recovering', namely
`[casRetryH, networkRetryH]'
In the expression: recovering set [casRetryH, networkRetryH] f
src/Database/Cassandra/Basic.hs:404:47:
Couldn't match expected type `lifted-base-0.2.1.0:Control.Exception.Lifted.Handler
m Bool'
with actual type `MCIO.Handler m1 Bool'
In the expression: networkRetryH
In the second argument of `recovering', namely
`[casRetryH, networkRetryH]'
In the expression: recovering set [casRetryH, networkRetryH] f
Failed to install cassy-0.5.1.0
cabal: Error: some packages failed to install:
cassy-0.5.1.0 failed during the building phase. The exception was:
ExitFailure 1
errors-2.0
will be switching to use ExceptT
instead of EitherT
. If that will break your package, then add an upper bound of errors < 2.0
to your dependencies.
I got
src/Thrift/Transport/HttpClient.hs:28:8:
Could not find module ‘Network.URI’
It is a member of the hidden package ‘network-uri-2.6.0.3@7wV1dpAdN91FDn2A3qFHGv’.
Perhaps you need to add ‘network-uri’ to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.
cabal: Error: some packages failed to install:
Thrift-0.6.0 failed during the building phase. The exception was:
ExitFailure 1
cassandra-thrift-0.8.5.1 depends on Thrift-0.6.0 which failed to install.
cassy-0.7.1 depends on Thrift-0.6.0 which failed to install.
cassy-test-0.1.0.0 depends on Thrift-0.6.0 which failed to install.
rror while building even I fetched network-uri 2.6.0.3 using cabal fetch manually.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.