Help us shape the future of Go! Take the 2026 Go Developer Survey

definition

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeSelect = "select"
	TypeInsert = "insert"
	TypeUpdate = "update"
	TypeDelete = "delete"
)

Variables

Functions

func DetectSQLType

func DetectSQLType(sql string) string

DetectSQLType SQLクエリから操作タイプを自動判定

Types

type Definition

type Definition struct {
	Version    int               `yaml:"version"`
	Params     map[string]string `yaml:"params"`
	Operations []Operation       `yaml:"operations"`
}

func LoadDefinition

func LoadDefinition(configPath string) (*Definition, error)

func (*Definition) ProcessTemplates

func (d *Definition) ProcessTemplates() error

func (*Definition) Validate

func (d *Definition) Validate() error

type Operation

type Operation struct {
	ID              string                   `yaml:"id,omitempty"`
	Description     string                   `yaml:"description,omitempty"`
	Type            string                   `yaml:"type,omitempty"`
	SQL             string                   `yaml:"sql"`
	Expected        []map[string]interface{} `yaml:"expected,omitempty"`
	ExpectedChanges map[string]int           `yaml:"expected_changes,omitempty"`
}

type Report

type Report struct {
	ID          string      `json:"id"`
	Description string      `json:"description"`
	Type        string      `json:"type"`
	SQL         string      `json:"sql"`
	Result      interface{} `json:"result"`
	Pass        bool        `json:"pass"`
	Message     string      `json:"message"`
}

Jump to

Keyboard shortcuts

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