sql

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExecutor

func NewExecutor(dialectType database.SQLDialectType) (database.SQL, error)

Types

type Executor

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

func New

func (*Executor) Close

func (e *Executor) Close(_ context.Context) error

func (*Executor) Dialect

func (e *Executor) Dialect() database.SQLDialect

func (*Executor) IsClosed

func (e *Executor) IsClosed() bool

func (*Executor) Open

func (e *Executor) Open(ctx context.Context) error

func (*Executor) Ping

func (e *Executor) Ping(ctx context.Context) error

func (*Executor) Request

func (e *Executor) Request(ctx context.Context, request database.Request) (any, error)

func (*Executor) Type

func (e *Executor) Type() database.Type

Type implements database.SQL.

type Keyword

type Keyword int
const (
	Select            Keyword = iota // SELECT
	Insert                           // INSERT
	Update                           // UPDATE
	Delete                           // DELETE
	From                             // FROM
	Where                            // WHERE
	Set                              // SET
	Values                           // VALUES
	OrderBy                          // ORDER BY
	Asc                              // ASC
	Desc                             // DESC
	Limit                            // LIMIT
	Offset                           // OFFSET
	GroupBy                          // GROUP BY
	Having                           // HAVING
	Join                             // JOIN
	LeftJoin                         // LEFT JOIN
	RightJoin                        // RIGHT JOIN
	FullJoin                         // FULL JOIN
	CrossJoin                        // CROSS JOIN
	On                               // ON
	As                               // AS
	InnerJoin                        // INNER JOIN
	OuterJoin                        // OUTER JOIN
	Union                            // UNION
	Intersect                        // INTERSECT
	Except                           // EXCEPT
	UnionAll                         // UNION ALL
	IntersectAll                     // INTERSECT ALL
	ExceptAll                        // EXCEPT ALL
	Not                              // NOT
	In                               // IN
	Between                          // BETWEEN
	And                              // AND
	Or                               // OR
	IsNull                           // IS NULL
	IsNotNull                        // IS NOT NULL
	IsTrue                           // IS TRUE
	IsFalse                          // IS FALSE
	IsUnknown                        // IS UNKNOWN
	IsDistinctFrom                   // IS DISTINCT FROM
	IsNotDistinctFrom                // IS NOT DISTINCT FROM
	Like                             // LIKE
	NotLike                          // NOT LIKE
	Ilike                            // ILIKE
	NotIlike                         // NOT ILIKE
	Any                              // ANY
	All                              // ALL
	Exists                           // EXISTS
	Some                             // SOME
	Unique                           // UNIQUE
	PrimaryKey                       // PRIMARY KEY
	ForeignKey                       // FOREIGN KEY
	Check                            // CHECK
	Default                          // DEFAULT
	Null                             // NULL
	True                             // TRUE
	False                            // FALSE
	Unknown                          // UNKNOWN

	Call    // CALL
	Exec    // EXEC
	Execute // EXECUTE
	Pragma  // PRAGMA
)

func (Keyword) String

func (i Keyword) String() string

type Prefab

type Prefab struct {
	CurrentDatabase database.Request
	Databases       database.Request
	Tables          database.Request
	Columns         func(tableName string) database.Request
}

func CreateMsSQLPrefabs

func CreateMsSQLPrefabs() *Prefab

func CreateMySQLPrefabs

func CreateMySQLPrefabs() *Prefab

func CreateOraclePrefabs

func CreateOraclePrefabs() *Prefab

func CreatePostgresPrefabs

func CreatePostgresPrefabs() *Prefab

func CreateSQLServerPrefabs

func CreateSQLServerPrefabs() *Prefab

func CreateSQLitePrefabs

func CreateSQLitePrefabs() *Prefab

type QueryPrefab

type QueryPrefab struct {
	Postgres  *Prefab
	MySQL     *Prefab
	SQLite3   *Prefab
	MsSQL     *Prefab
	Oracle    *Prefab
	SQLServer *Prefab
}
var Prefabs *QueryPrefab = CreateQueryPrefabs()

func CreateQueryPrefabs

func CreateQueryPrefabs() *QueryPrefab

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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