exporter

package
v0.0.0-...-56a2066 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSQL

func GenerateSQL(inputType interface{}, pkg string, opt Options, schemaTarget SchemaTarget, ttlExcludeTables []string) string

GenerateSQL takes in a "table type", that is a table whose fields are slices. Each field will be interpreted as a table. The sql struct tags will be used to generate the SQL schema. A package name is taken in to be included in the returned string. If a malformed type is passed in, this function will panic.

Types

type Options

type Options int

Options to control the generation done by GenerateSQL.

const (
	SchemaOnly Options = iota
	SchemaAndColumnNames
)

type SchemaTarget

type SchemaTarget int

SchemaTarget defines the target db to generate the schema for.

const (
	CockroachDB SchemaTarget = iota
	Spanner
)

Jump to

Keyboard shortcuts

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