Skip to content

Can't find schema file /schema/ #143

Open
@Citrullin

Description

I get the following error:

[error] /home/citrullin/git/scala-troy/src/main/scala/model/PageImpressionByYearMonth.scala:19: Can't find schema file /schema/
[error]   val getByYearMonth = withSchema {

Let's take a look into the code.

package model

import com.datastax.driver.core.{Cluster, Session}
import connection.ConnectionProvider
import entity.PageImpression
import troy.dsl._
import troy.driver.DSL._

import scala.concurrent.Future

class PageImpressionByYearMonth(connection: ConnectionProvider) {
  import scala.concurrent.ExecutionContext.Implicits.global
  val cluster = connection.cluster
  implicit val session: Session = connection.session

  val keyspace = "analytics"
  val tableName = "pageimpressionbyyearmonth"

  val getByYearMonth = withSchema {
    (year: Int, month: Int) =>
    cql"""
          SELECT * FROM analytics.pageimpressionbyyearmonth WHERE year = $year AND month = $month
      """.prepared.executeAsync.as(PageImpression)
  }

  def get(year: Int, month: Int): Future[Seq[PageImpression]] = getByYearMonth(year, month)
}

The schema file is in probject/src/main/resources/schema.cql and project/src/test/resources/schema.cql. I also checked probject/src/main/resources/schmea/schema.cql and probject/src/test/resources/schema.cql. I think there is something wrong with the relative path. Instead of a relative path it seems like it uses a absolute path.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions