7

I'd like to use the Phantom DSL for Cassandra from Scala. I've noted that it uses the Datastax Java driver underneath, but I don't see anything in the documentation about how to actually connect or configure a connection. The included tests use an embedded Cassandra, so that doesn't help. Are there any detailed examples or tutorials for this library?

flavian
  • 28,161
  • 11
  • 65
  • 105
Isvara
  • 3,403
  • 1
  • 28
  • 42

1 Answers1

2

To run operations with Phantom "tables" you need to have implicit Session object in scope. One way to achieve that is CassandraConnector, and you can build connectors using ContactPoint. For instance you can use this example.

Or you can build your own way of initializing implicit Session.

Update

Additionally you can read about connectors in more depth on this blog post.

flavian
  • 28,161
  • 11
  • 65
  • 105
Eugene Zhulenev
  • 9,714
  • 2
  • 30
  • 40
  • 2
    Also you can take a look at this example: https://github.com/websudos/phantom/blob/develop/phantom-example/src/main/scala/com/websudos/phantom/example/basics/DBConnector.scala – Eugene Zhulenev Oct 08 '14 at 03:29
  • Is this Simple Connector the best way to go for production? – Thiago Pereira Apr 15 '15 at 11:55
  • 1
    @ThiagoPereira You can easily override the way clusters are built to add logging information and so forth. Depending on how many Cassandra nodes you are using the connector is a good fit. – flavian May 11 '15 at 21:27