generation

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ResourceSource     string
	HandlerDestination string
	SpannerDestination string
	Migrations         string
	PluralRules        map[string]string
	HandlerOptions     map[string]map[HandlerType][]OptionType
}

type ConstraintType

type ConstraintType string
const (
	PrimaryKey ConstraintType = "PRIMARY KEY"
	ForeignKey ConstraintType = "FOREIGN KEY"
)

type FieldMetadata

type FieldMetadata struct {
	ConstraintType ConstraintType
	ColumnName     string
	SpannerType    string
	IsNullable     bool
	IsIndex        bool
}

type GenerationClient

type GenerationClient struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, config *Config) (*GenerationClient, error)

func (*GenerationClient) Close

func (c *GenerationClient) Close()

func (*GenerationClient) RunHandlerGeneration

func (c *GenerationClient) RunHandlerGeneration() error

func (*GenerationClient) RunSpannerGeneration

func (c *GenerationClient) RunSpannerGeneration() error

type HandlerType

type HandlerType string
const (
	List  HandlerType = "list"
	Read  HandlerType = "read"
	Patch HandlerType = "patch"
)

type InformationSchemaResult

type InformationSchemaResult struct {
	TableName      string  `spanner:"TABLE_NAME"`
	ColumnName     string  `spanner:"COLUMN_NAME"`
	ConstraintName *string `spanner:"CONSTRAINT_NAME"`
	ConstraintType *string `spanner:"CONSTRAINT_TYPE"`
	SpannerType    string  `spanner:"SPANNER_TYPE"`
	IsNullable     bool    `spanner:"IS_NULLABLE"`
	IsView         bool    `spanner:"IS_VIEW"`
	IsIndex        bool    `spanner:"IS_INDEX"`
}

type OptionType

type OptionType string
const (
	Regenerate OptionType = "regenerate"
	NoGenerate OptionType = "nogenerate"
)

type PatchType

type PatchType string
const (
	CreatePatch PatchType = "Create"
	UpdatePatch PatchType = "Update"
)

type TableMetadata

type TableMetadata struct {
	Columns map[string]FieldMetadata
	IsView  bool
}

Jump to

Keyboard shortcuts

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