package redshift
- Alphabetic
- Public
- All
Type Members
- case class AddColumn(columnName: String, columnType: DataType, default: Option[Default], encode: Option[CompressionEncoding], nullability: Option[Nullability]) extends AlterTableStatement with Product with Serializable
- case class AddConstraint(tableConstraint: TableConstraint) extends AlterTableStatement with Product with Serializable
-
case class
AlterTable(tableName: String, statement: AlterTableStatement) extends Statement with Product with Serializable
Class holding data to alter some table with single AlterTableStatement
Class holding data to alter some table with single AlterTableStatement
- See also
http://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_TABLE.html ALTER TABLE table_name { ADD table_constraint | DROP CONSTRAINT constraint_name [ RESTRICT | CASCADE ] | OWNER TO new_owner | RENAME TO new_name | RENAME COLUMN column_name TO new_name | ADD [ COLUMN ] column_name column_type [ DEFAULT default_expr ] [ ENCODE encoding ] [ NOT NULL | NULL ] | DROP [ COLUMN ] column_name [ RESTRICT | CASCADE ] } where table_constraint is: [ CONSTRAINT constraint_name ] { UNIQUE ( column_name [, ... ] ) | PRIMARY KEY ( column_name [, ... ] ) | FOREIGN KEY (column_name [, ... ] ) REFERENCES reftable [ ( refcolumn ) ]}
-
sealed
trait
AlterTableStatement extends Ddl
Sum-type to represent some statement
- case class AlterType(columnName: String, dataType: DataType) extends AlterTableStatement with Product with Serializable
- case class Begin(isolationLevel: Option[IsolationLevel.type], permission: Option[Permission]) extends Statement with Product with Serializable
-
case class
Column(columnName: String, dataType: DataType, columnAttributes: Set[ColumnAttribute] = Set.empty[ColumnAttribute], columnConstraints: Set[ColumnConstraint] = Set.empty[ColumnConstraint]) extends Ddl with Product with Serializable
Class holding all information about Redshift's column
Class holding all information about Redshift's column
- columnName
column_name
- dataType
data_type such as INTEGER, VARCHAR, etc
- columnAttributes
set of column_attributes such as ENCODE
- columnConstraints
set of column_constraints such as NOT NULL
-
sealed
trait
ColumnAttribute extends Ddl
column_attributes are: [ DEFAULT default_expr ] [ IDENTITY ( seed, step ) ] [ ENCODE encoding ] [ DISTKEY ] [ SORTKEY ]
-
sealed
trait
ColumnConstraint extends Ddl
column_constraints are: [ { NOT NULL | NULL } ] [ { UNIQUE | PRIMARY KEY } ] [ REFERENCES reftable [ ( refcolumn ) ] ]
-
case class
CommentBlock(lines: Vector[String], prepend: Int = 0) extends Statement with Product with Serializable
Class representing comment block in Ddl file Can be rendered into file along with other Ddl-statements
Class representing comment block in Ddl file Can be rendered into file along with other Ddl-statements
- lines
sequence of lines
- prepend
optional amount of spaces to prepend delimiter (--)
-
case class
CommentOn(tableName: String, comment: String) extends Statement with Product with Serializable
COMMENT ON { TABLE object_name | COLUMN object_name.column_name | CONSTRAINT constraint_name ON table_name | DATABASE object_name | VIEW object_name } IS 'text'
-
case class
CompressionEncoding(value: CompressionEncodingValue) extends ColumnAttribute with Product with Serializable
Compression encodings http://docs.aws.amazon.com/redshift/latest/dg/c_Compression_encodings.html
- sealed trait CompressionEncodingValue extends Ddl
- case class CreateSchema(schemaName: String) extends Statement with Product with Serializable
-
case class
CreateTable(tableName: String, columns: List[Column], tableConstraints: Set[TableConstraint] = Set.empty[TableConstraint], tableAttributes: Set[TableAttribute] = Set.empty[TableAttribute]) extends Statement with Product with Serializable
Class holding all information about Redshift's table
Class holding all information about Redshift's table
- tableName
table_name
- columns
iterable of all columns DDLs
- tableConstraints
set of table_constraints such as PRIMARY KEY
- tableAttributes
set of table_attributes such as DISTSTYLE
-
sealed
trait
DataType extends Ddl
Data types http://docs.aws.amazon.com/redshift/latest/dg/c_Supported_data_types.html
-
trait
Ddl extends AnyRef
Base class for everything that can be represented as Redshift DDL
- case class Default(value: String) extends ColumnAttribute with Product with Serializable
- case class DistKeyTable(columnName: String) extends TableAttribute with Product with Serializable
- case class Diststyle(diststyle: DiststyleValue) extends TableAttribute with Product with Serializable
- sealed trait DiststyleValue extends Ddl
- case class DropColumn(columnName: String, mode: Option[DropMode]) extends Ddl with Product with Serializable
- case class DropConstraint(constraintName: String, mode: Option[DropMode]) extends AlterTableStatement with Product with Serializable
- case class DropMode(value: DropModeValue) extends Ddl with Product with Serializable
- sealed trait DropModeValue extends Ddl
- case class ForeignKeyTable(columns: NonEmptyList[String], reftable: RefTable) extends TableConstraint with Product with Serializable
- case class Identity(seed: Int, step: Int) extends ColumnAttribute with Product with Serializable
- case class KeyConstaint(value: KeyConstraintValue) extends ColumnConstraint with Product with Serializable
- sealed trait KeyConstraintValue extends Ddl
- case class Nullability(value: NullabilityValue) extends ColumnConstraint with Product with Serializable
- sealed trait NullabilityValue extends Ddl
- case class OwnerTo(newOwner: String) extends AlterTableStatement with Product with Serializable
- sealed trait Permission extends Ddl
- case class PrimaryKeyTable(columns: NonEmptyList[String]) extends TableConstraint with Product with Serializable
-
case class
ProductType(warnings: List[String], size: Option[Int]) extends DataType with Product with Serializable
These predefined data types assembles into usual Redshift data types, but can store additional information such as warnings.
These predefined data types assembles into usual Redshift data types, but can store additional information such as warnings. Using to prevent output on DDL-generation step.
- case class RedshiftChar(size: Int) extends DataType with Product with Serializable
- case class RedshiftDecimal(precision: Option[Int], scale: Option[Int]) extends DataType with Product with Serializable
- case class RedshiftVarchar(size: Int) extends DataType with Product with Serializable
-
case class
RefTable(reftable: String, refcolumn: Option[String]) extends Ddl with Product with Serializable
Reference table.
Reference table. Used in foreign key and table constraint
- reftable
name of table
- refcolumn
optional column
- case class RenameColumn(columnName: String, newName: String) extends AlterTableStatement with Product with Serializable
- case class RenameTo(newName: String) extends AlterTableStatement with Product with Serializable
- case class SortKeyTable(sortstyle: Option[Sortstyle], columns: NonEmptyList[String]) extends TableAttribute with Product with Serializable
- sealed trait Sortstyle extends Ddl
-
trait
Statement extends Ddl with Product with Serializable
Trait for *independent* SQL DDL statements.
Trait for *independent* SQL DDL statements. Unlike simple Ddl objects, these can be used as stand-alone commands and be content of file. We're always using semicolon in the end of statements
-
sealed
trait
TableAttribute extends Ddl
table_attributes are: [ DISTSTYLE { EVEN | KEY | ALL } ] [ DISTKEY ( column_name ) ] [ [COMPOUND | INTERLEAVED ] SORTKEY ( column_name [, ...] ) ]
-
sealed
trait
TableConstraint extends Ddl
table_constraints are: [ UNIQUE ( column_name [, ...
table_constraints are: [ UNIQUE ( column_name [, ... ] ) ] [ PRIMARY KEY ( column_name [, ... ] ) ] [ FOREIGN KEY (column_name [, ... ] ) REFERENCES reftable [ ( refcolumn ) ]
- case class UniqueKeyTable(columns: NonEmptyList[String]) extends TableConstraint with Product with Serializable
Value Members
- object All extends DiststyleValue with Product with Serializable
- object ByteDictEncoding extends CompressionEncodingValue with Product with Serializable
- object CascadeDrop extends DropModeValue with Product with Serializable
- object CommentBlock extends Serializable
- object CompoundSortstyle extends Sortstyle with Product with Serializable
- object Delta32kEncoding extends CompressionEncodingValue with Product with Serializable
- object DeltaEncoding extends CompressionEncodingValue with Product with Serializable
- object DistKey extends ColumnAttribute with Product with Serializable
- object Empty extends Statement with Product with Serializable
- object End extends Statement with Product with Serializable
- object Even extends DiststyleValue with Product with Serializable
- object InterleavedSortstyle extends Sortstyle with Product with Serializable
- object IsolationLevel extends Ddl with Product with Serializable
- object Key extends DiststyleValue with Product with Serializable
- object LzoEncoding extends CompressionEncodingValue with Product with Serializable
- object Mostly16Encoding extends CompressionEncodingValue with Product with Serializable
- object Mostly32Encoding extends CompressionEncodingValue with Product with Serializable
- object Mostly8Encoding extends CompressionEncodingValue with Product with Serializable
- object NotNull extends NullabilityValue with Product with Serializable
- object Null extends NullabilityValue with Product with Serializable
- object PrimaryKey extends KeyConstraintValue with Product with Serializable
- object RawEncoding extends CompressionEncodingValue with Product with Serializable
- object ReadOnly extends Permission with Product with Serializable
- object ReadWriteIsolation extends Permission with Product with Serializable
- object RedshiftBigInt extends DataType with Product with Serializable
- object RedshiftBoolean extends DataType with Product with Serializable
- object RedshiftDate extends DataType with Product with Serializable
- object RedshiftDouble extends DataType with Product with Serializable
- object RedshiftInteger extends DataType with Product with Serializable
- object RedshiftReal extends DataType with Product with Serializable
- object RedshiftSmallInt extends DataType with Product with Serializable
- object RedshiftTimestamp extends DataType with Product with Serializable
- object RestrictDrop extends DropModeValue with Product with Serializable
- object RunLengthEncoding extends CompressionEncodingValue with Product with Serializable
- object SortKey extends ColumnAttribute with Product with Serializable
- object Text255Encoding extends CompressionEncodingValue with Product with Serializable
- object Text32KEncoding extends CompressionEncodingValue with Product with Serializable
- object Unique extends KeyConstraintValue with Product with Serializable
- object ZstdEncoding extends CompressionEncodingValue with Product with Serializable