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

ldbc.schema.attribute.package.scala Maven / Gradle / Ivy

/**
 * Copyright (c) 2023-2024 by Takahiko Tominaga
 * This software is licensed under the MIT License (MIT).
 * For more information see LICENSE or https://opensource.org/licenses/MIT
 */

package ldbc.schema

package object attribute:

  private[ldbc] trait Attribute[T]:

    /**
     * Define an SQL query string for each attribute.
     *
     * @return
     *   SQL query string
     */
    def queryString: String

  private[ldbc] case class Comment[T](message: String) extends Attribute[T]:
    override def queryString: String = s"COMMENT '$message'"

  private[ldbc] case class Visible[T]() extends Attribute[T]:
    override def queryString: String = "/*!80023 VISIBLE */"

  private[ldbc] case class InVisible[T]() extends Attribute[T]:
    override def queryString: String = "/*!80023 INVISIBLE */"

  private[ldbc] trait ColumnFormat[T] extends Attribute[T]
  object ColumnFormat:
    case class Fixed[T]() extends ColumnFormat[T]:
      override def queryString: String = "/*!50606 COLUMN_FORMAT FIXED */"

    case class Dynamic[T]() extends ColumnFormat[T]:
      override def queryString: String = "/*!50606 COLUMN_FORMAT DYNAMIC */"

    case class Default[T]() extends ColumnFormat[T]:
      override def queryString: String = "/*!50606 COLUMN_FORMAT DEFAULT */"

  private[ldbc] trait Storage[T] extends Attribute[T]
  object Storage:
    case class Disk[T]() extends Storage[T]:
      override def queryString: String = "/*!50606 STORAGE DISK */"

    case class Memory[T]() extends Storage[T]:
      override def queryString: String = "/*!50606 STORAGE MEMORY */"




© 2015 - 2024 Weber Informatics LLC | Privacy Policy