model

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 1 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          string
	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               string
	Function            enum.FunctionType
	AttributeValue      string
	AttributeValueTable string
}

type OrderBy

type OrderBy struct {
	Desc      bool
	Attribute Attribute
}

type Query

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

	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
}

type Set

type Set struct {
	Attribute any
	Value     any
}

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