question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide support for phantom-dsl

See original GitHub issue

Instead of writing CQL queries in lagom projects it would be nice if we could use phantom-dsl (see https://github.com/outworkers/phantom) and use the lagom infrastructure for the Cassandra session management.

The benefits: The dsl provides a type safe way on querying and writing into the Cassandra database, for example:

case class DomainObject(id: UUID, description: String)

abstract class DomainObjects extends Table[DomainObjects, DomainObject] {
  object id extends UUIDColumn with PartitionKey
  object description extends StringColumn

  def getById(id: UUID): Future[Option[DomainObject]] = {
    select.where(_.id eqs id).one()
  }
}

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
WayneWang12commented, Mar 12, 2019

quill-cassandra-lagom is released! Add libraryDependencies += "io.getquill" %% "quill-cassandra-lagom" % "3.1.0" to your build.sbt, then create a context in your application definition:

  lazy val quillContext: CassandraLagomAsyncContext[SnakeCase]        = wire[CassandraLagomAsyncContext[SnakeCase]]
  lazy val quillStreamContext: CassandraLagomStreamContext[SnakeCase] = wire[CassandraLagomStreamContext[SnakeCase]]

It will reuse Lagom’s cassandra session automatically. Then you can use it in quill way in your code:

    import ctx._
    val q = quote(
      query[AnalysisEvent]
        .filter(evt =>
          evt.tenantId == lift(tenantId) &&
            evt.userSetId == lift(userSetId)))
    ctx.run(q)

If you are using CassandraLagomAsyncContext, result will be Future[List[AnalysisEvent]]; if CassandraLagomStreamContext, result will be Source[AnalysisEvent, NotUsed].

0reactions
WayneWang12commented, Jan 16, 2019

@ihostage I’m communicating with them. If they don’t accept, I’ll create my own project.

Luckily one of quill’s maintainers @jilen is Chinese. I can talk to him directly in native language.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently Asked Questions (FAQ) - PhantomJS
A: Binary packages, executables, and installer are provided on a volunteer ... A: If you want to know HTML5/CSS3/other features supported by PhantomJS, ......
Read more >
Command Line Interface - PhantomJS
Supported command-line options are: --help or -h lists all possible command-line options. ... --local-storage-quota=number maximum size to allow for data.
Read more >
Supported Web Standards - PhantomJS
PhantomJS uses QtWebKit. It supports many features which are part of http://trac.webkit.org/wiki/QtWebKitFeatures22. Unsupported Features. Support for plugins ( ...
Read more >
Troubleshooting - PhantomJS
All examples are designed to work with the latest version of PhantomJS. If some examples do not work, make sure that there is...
Read more >
Related Projects - PhantomJS
Also provides additional stack tracing, helpers and module bootstrapping. ... screenshot-as-a-service (Node.js); screenshot-service a pure phantomJS project ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found