ddl

package
v0.24.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

README

DDL Generator

TODO:

  • Enum generation
  • DSL for enum
  • DSL for compression codecs
  • Go code generation
    • Enums
    • Table helper initialization

Migrations

Should support migrations on later stages of development via ALTER TABLE statements.

Documentation

Overview

Package ddl provides facilities for generating DDL statements and auxiliary code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Backtick

func Backtick(s string) string

Backtick adds backticks to the string.

func Generate

func Generate(t Table) (string, error)

Generate DDL without CREATE TABLE statement.

Types

type Column

type Column struct {
	Name         string
	Comment      string
	Default      string
	Type         proto.ColumnType
	Codec        proto.ColumnType
	Materialized string
}

Column of Table.

type Index added in v0.16.0

type Index struct {
	Name        string
	Target      string
	Type        string
	Params      []string
	Granularity int
}

type TTL added in v0.16.0

type TTL struct {
	Field string
	Delta time.Duration
}

type Table

type Table struct {
	Name        string
	Cluster     string
	Columns     []Column
	Indexes     []Index
	OrderBy     []string
	PrimaryKey  []string
	PartitionBy string
	Engine      string
	TTL         TTL
}

Table description.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL