zig

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Backend

type Backend string
const (
	PGZigBackend  Backend = "pg.zig"
	ZqliteBackend Backend = "zqlite.zig"
)

func (Backend) ImportName

func (b Backend) ImportName() string

func (Backend) IsValidFor added in v0.0.13

func (b Backend) IsValidFor(req *plugin.GenerateRequest) bool

type Config

type Config struct {
	Backend                     Backend  `json:"backend"`
	EmitExactTableNames         bool     `json:"emit_exact_table_names"`
	InflectionExcludeTableNames []string `json:"inflection_exclude_table_names"`
	QueryParameterLimit         int      `json:"query_parameter_limit"`
	PublicQueryStings           bool     `json:"public_query_strings"`
	UnmanagedAllocations        bool     `json:"unmanaged_allocations"`
	UseContext                  bool     `json:"use_context"`
	PGErrorUnions               bool     `json:"pg_error_unions"`
}

func (*Config) Default

func (c *Config) Default(req *plugin.GenerateRequest)

func (*Config) Validate

func (c *Config) Validate(req *plugin.GenerateRequest) error

type Enum

type Enum struct {
	Name    string
	ZigName string
	Comment string
	Values  []string
}

type Field

type Field struct {
	Name     string
	Comment  string
	ZigType  string
	Nullable bool
	Array    bool
	Index    int
	Enum     bool
}

func (Field) ZigID added in v0.0.12

func (f Field) ZigID() string

type Identifier

type Identifier struct {
	Schema string
	Name   string
}

type Query

type Query struct {
	Cmd          string
	Comments     []string
	MethodName   string
	FieldName    string
	ConstantName string
	SQL          string
	SourceName   string
	Ret          *QueryValue
	Args         []QueryValue
}

func (*Query) ArgNames added in v0.0.3

func (q *Query) ArgNames() []string

func (*Query) RequiresAllocations added in v0.0.7

func (q *Query) RequiresAllocations() bool

type QueryValue

type QueryValue struct {
	Emit   bool
	Name   string
	Struct *Struct
	Field  *Field
}

type Struct

type Struct struct {
	ID         Identifier
	TableName  string
	StructName string
	Comment    string
	Fields     []Field
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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