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

com.crobox.clickhouse.dsl.execution.QueryExecutor.scala Maven / Gradle / Ivy

There is a newer version: 1.2.5
Show newest version
package com.crobox.clickhouse.dsl.execution

import com.crobox.clickhouse.ClickhouseServerVersion
import com.crobox.clickhouse.dsl.language.TokenizerModule
import com.crobox.clickhouse.dsl.{Query, Table}
import com.crobox.clickhouse.internal.QuerySettings
import spray.json._

import scala.concurrent.{ExecutionContext, Future}

/**
 * Module that can execute queries, to return a future of result
 */
trait QueryExecutor { self: TokenizerModule =>

  def serverVersion: ClickhouseServerVersion

  def query[V: JsonReader](sql: String)(implicit executionContext: ExecutionContext,
                                        settings: QuerySettings = QuerySettings()): Future[QueryResult[V]]

  def execute[V: JsonReader](query: Query)(implicit executionContext: ExecutionContext,
                                           settings: QuerySettings = QuerySettings()): Future[QueryResult[V]]

  def insert[V: JsonWriter](table: Table, values: Seq[V])(implicit executionContext: ExecutionContext,
                                                          settings: QuerySettings = QuerySettings()): Future[String]

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy