
com.crobox.clickhouse.schemabuilder.CreateDatabase.scala Maven / Gradle / Ivy
The newest version!
package com.crobox.clickhouse.schemabuilder
import com.crobox.clickhouse.ClickhouseStatement
/**
* @author Sjoerd Mulder
* @since 2-1-17
*/
case class CreateDatabase(dbName: String, ifNotExists: Boolean = false) extends ClickhouseSchemaStatement {
require(ClickhouseStatement.isValidIdentifier(dbName), s"Invalid database name identifier")
/**
* Returns the query string for this statement.
*
* @return String containing the Clickhouse dialect SQL statement
*/
override def query: String = s"CREATE DATABASE${printIfNotExists(ifNotExists)} $dbName"
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy