I'm trying to connect to the cassandra database (With scala 2.11.2) using the phantom scala driver
I followed this article on their blog: http://blog.websudos.com/2014/08/a-series-on-cassandra-part-1-getting-rid-of-the-sql-mentality/
(note on github there is only phantom-dsl jar compiled in 2.11, I don't know if a problem?)
I've only one dependency with phantom
<dependency>
<groupId>com.websudos</groupId>
<artifactId>phantom-dsl_2.11</artifactId>
<version>1.2.7</version>
</dependency>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
<version>2.0.1</version>
</dependency>
When I compile my project, I get this error about session :
Main.scala:32: error: could not find implicit value for parameter session: com.datastax.driver.core.Session
[ERROR] select.where(_.firstName eqs firstName).limit(5000).fetch()
[ERROR] ^
[ERROR] one error found
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
On their github, there is an example with a session :
implicit val session = SomeCassandraClient.session;
But I don't understand where SomeCassandraClient is located ?
Any advice ?
You can take the session from your connector (which is the 'SomeCassandraClient you are looking for).
Somewhere you have defined your connector like:
then just do a
That way you don't have to define multiple time your connection IP and keyspace ;-)