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

com.crobox.clickhouse.dsl.schemabuilder.CreateDatabase.scala Maven / Gradle / Ivy

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

import com.crobox.clickhouse.dsl.ClickhouseStatement

/**
 * @author Sjoerd Mulder
 * @since 2-1-17
 */
case class CreateDatabase(dbName: String, ifNotExists: Boolean = false, clusterName : Option[String] = None)
  extends ClickhouseSchemaStatement with DistributedDdlSupport {

  /**
   * Returns the query string for this statement.
   *
   * @return String containing the Clickhouse dialect SQL statement
   */
  override def query: String = s"CREATE DATABASE${printIfNotExists(ifNotExists)} ${ClickhouseStatement.quoteIdentifier(dbName)}${printOnCluster()}"
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy