tsql

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ALL = all{}

Functions

func SELECT

func SELECT(table Table, fields ...SQLer) *_Select

Types

type Create

type Create struct {
	Table  Table
	Fields []_createFields
}

func CREATE

func CREATE(table Table, fields ..._createFields) *Create

func (*Create) SQL

func (c *Create) SQL() string

func (*Create) String

func (c *Create) String() string

type Delete

type Delete struct {
	Table Table
	// contains filtered or unexported fields
}

func DELETE

func DELETE(table Table) *Delete

func (*Delete) SQL

func (c *Delete) SQL() string

func (*Delete) String

func (c *Delete) String() string

func (*Delete) WHERE

func (s *Delete) WHERE(where SQLer) *Delete

type Dollar

type Dollar int

func (Dollar) SQL

func (d Dollar) SQL() string

func (Dollar) ValueToSQL

func (d Dollar) ValueToSQL(pos int) string

type Field

type Field[V any] struct {
	Name            string
	Nullable        bool
	References      *tableField[V]
	IsPrimaryKey    bool
	Description     string
	Value           V
	MaxLength       int
	IsAutoIncrement bool
}

func (Field[V]) CreationSQL

func (f Field[V]) CreationSQL() string

func (*Field[V]) GetTarget

func (c *Field[V]) GetTarget() any

func (Field[V]) InnerJoin

func (c Field[V]) InnerJoin(joinField *tableField[V]) Join

func (Field[V]) InnerJoinAlias

func (c Field[V]) InnerJoinAlias(joinField *tableField[V], alias string) Join

func (Field[V]) Is

func (f Field[V]) Is(value V) where

func (Field[V]) IsEqualOrGreaterThan

func (f Field[V]) IsEqualOrGreaterThan(value V) where

func (Field[V]) IsEqualOrLessThan

func (f Field[V]) IsEqualOrLessThan(value V) where

func (Field[V]) IsGreaterThan

func (f Field[V]) IsGreaterThan(value V) where

func (Field[V]) IsIn

func (f Field[V]) IsIn(value SQLer) where

func (Field[V]) IsLessThan

func (f Field[V]) IsLessThan(value V) where

func (Field[V]) IsNot

func (f Field[V]) IsNot(value V) where

func (Field[V]) Of

func (f Field[V]) Of(table Table) *tableField[V]

func (Field[V]) OuterJoin

func (c Field[V]) OuterJoin(joinField *tableField[V]) Join

func (Field[V]) OuterJoinAlias

func (c Field[V]) OuterJoinAlias(joinField *tableField[V], alias string) Join

func (Field[V]) SQL

func (f Field[V]) SQL() string

func (Field[V]) Set

func (f Field[V]) Set(value V) Field[V]

func (Field[V]) Type

func (f Field[V]) Type() string

func (Field[V]) ValueToSQL

func (f Field[V]) ValueToSQL(pos int) string

type Insert

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

func INSERT

func INSERT(table Table, fields ..._insertFields) *Insert

func (*Insert) SQL

func (c *Insert) SQL() string

func (*Insert) String

func (c *Insert) String() string

type Join

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

type SQL

type SQL string

func AND

func AND(wheres ...SQLer) SQL

func OR

func OR(wheres ...SQLer) SQL

func (SQL) SQL

func (s SQL) SQL() string

type SQLer

type SQLer interface {
	SQL() string
}

type Table

type Table struct {
	Name string
}

func (Table) SQL

func (t Table) SQL() string

type Update

type Update struct {
	Table  Table
	Fields []_insertFields
	// contains filtered or unexported fields
}

func UPDATE

func UPDATE(table Table, fields ..._insertFields) *Update

func (*Update) SQL

func (c *Update) SQL() string

func (*Update) String

func (c *Update) String() string

func (*Update) WHERE

func (s *Update) WHERE(where SQLer) *Update

Jump to

Keyboard shortcuts

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