All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.fsq.rogue.util.QueryUtilities.scala Maven / Gradle / Ivy

Go to download

Foursquare's Scala DSL for constructing and executing find and modify commands against MongoDB

There is a newer version: 2.3.0
Show newest version
// Copyright 2017 Foursquare Labs Inc. All Rights Reserved.

package io.fsq.rogue.util

import io.fsq.rogue.IndexCheckerLogger
import io.fsq.rogue.indexchecker.{IndexChecker, MongoIndexChecker}


trait QueryUtilities[Result[_]] {
  def config: QueryConfig
  def indexChecker: IndexChecker
  def logger: QueryLogger[Result]
  def transformer: QueryTransformer
  def validator: QueryValidator
}

class DefaultQueryUtilities[Result[_]] extends QueryUtilities[Result] { self =>
  override val config: QueryConfig = new DefaultQueryConfig
  override val indexChecker: IndexChecker = new MongoIndexChecker {
    override def logger: IndexCheckerLogger = self.logger
  }
  override val logger: QueryLogger[Result] = new DefaultQueryLogger[Result]
  override val transformer: QueryTransformer = new DefaultQueryTransformer
  override val validator: QueryValidator = new DefaultQueryValidator
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy