model

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregate

type Aggregate interface {
	Aggregate() enum.AggregateType
}

type Attribute

type Attribute struct {
	Table         string
	Name          string
	AggregateType enum.AggregateType
	FunctionType  enum.FunctionType
}

type FunctionType

type FunctionType interface {
	GetType() enum.FunctionType
}

type Join

type Join struct {
	Table          Table
	FirstArgument  JoinArgument
	JoinOperation  enum.JoinType
	SecondArgument JoinArgument
}

type JoinArgument

type JoinArgument struct {
	Table string
	Name  string
}

type Joins

type Joins interface {
	FirstArg() any
	Join() enum.JoinType
	SecondArg() any
}

type Operation

type Operation struct {
	Type                enum.WhereType
	Arg                 any
	Value               ValueOperation
	Operator            enum.OperatorType
	Attribute           string
	Table               Table
	TableId             int
	Function            enum.FunctionType
	AttributeValue      string
	AttributeValueTable Table
	AttributeTableId    int
	FirstOperation      *Operation
	SecondOperation     *Operation
}

type OrderBy

type OrderBy struct {
	Desc      bool
	Attribute Attribute
}

type Query

type Query struct {
	Type       enum.QueryType
	Attributes []Attribute
	Tables     []Table

	Joins   []Join   //Select
	Limit   int      //Select
	Offset  int      //Select
	OrderBy *OrderBy //Select

	WhereOperations []Where //Select, Update and Delete
	WhereIndex      int     //Start of where position arguments $1, $2...
	Arguments       []any

	ReturningId    *Attribute //Insert
	BatchSizeQuery int        //Insert
	SizeArguments  int        //Insert

	RawSql string
	Header QueryHeader
}

type QueryHeader added in v0.2.0

type QueryHeader struct {
	Err           error
	ModelBuild    time.Duration
	QueryDuration time.Duration
}

type Set

type Set struct {
	Attribute any
	Value     any
}

type Table added in v0.5.0

type Table struct {
	Schema *string
	Name   string
}

func (Table) String added in v0.5.0

func (t Table) String() string

type ValueOperation

type ValueOperation interface {
	GetValue() any
}

type Where

type Where struct {
	Type           enum.WhereType
	Attribute      Attribute
	Operator       enum.OperatorType
	AttributeValue Attribute
	SizeIn         uint
	QueryIn        *Query
}

Jump to

Keyboard shortcuts

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