query

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package query provides query building for DML operations. This is a stub for future implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	// ToSQL generates the SQL string and arguments.
	ToSQL() (string, []any)
}

Builder is the main query builder interface.

type DeleteBuilder

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

DeleteBuilder builds DELETE queries.

func Delete

func Delete(table string) *DeleteBuilder

Delete starts building a DELETE query.

func (*DeleteBuilder) ToSQL

func (d *DeleteBuilder) ToSQL() (string, []any)

ToSQL generates the DELETE SQL. (stub implementation)

func (*DeleteBuilder) Where

func (d *DeleteBuilder) Where(condition string) *DeleteBuilder

Where adds a WHERE condition.

type InsertBuilder

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

InsertBuilder builds INSERT queries.

func Insert

func Insert(table string) *InsertBuilder

Insert starts building an INSERT query.

func (*InsertBuilder) Columns

func (i *InsertBuilder) Columns(columns ...string) *InsertBuilder

Columns sets the columns to insert into.

func (*InsertBuilder) ToSQL

func (i *InsertBuilder) ToSQL() (string, []any)

ToSQL generates the INSERT SQL. (stub implementation)

func (*InsertBuilder) Values

func (i *InsertBuilder) Values(values ...any) *InsertBuilder

Values sets the values to insert.

type SelectBuilder

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

SelectBuilder builds SELECT queries.

func Select

func Select(columns ...string) *SelectBuilder

Select starts building a SELECT query.

func (*SelectBuilder) From

func (s *SelectBuilder) From(table string) *SelectBuilder

From sets the table to select from.

func (*SelectBuilder) Limit

func (s *SelectBuilder) Limit(n int) *SelectBuilder

Limit sets the LIMIT clause.

func (*SelectBuilder) Offset

func (s *SelectBuilder) Offset(n int) *SelectBuilder

Offset sets the OFFSET clause.

func (*SelectBuilder) OrderBy

func (s *SelectBuilder) OrderBy(column string) *SelectBuilder

OrderBy adds an ORDER BY clause.

func (*SelectBuilder) ToSQL

func (s *SelectBuilder) ToSQL() (string, []any)

ToSQL generates the SELECT SQL. (stub implementation)

func (*SelectBuilder) Where

func (s *SelectBuilder) Where(condition string) *SelectBuilder

Where adds a WHERE condition.

type UpdateBuilder

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

UpdateBuilder builds UPDATE queries.

func Update

func Update(table string) *UpdateBuilder

Update starts building an UPDATE query.

func (*UpdateBuilder) Set

func (u *UpdateBuilder) Set(column string, value any) *UpdateBuilder

Set adds a column=value pair to update.

func (*UpdateBuilder) ToSQL

func (u *UpdateBuilder) ToSQL() (string, []any)

ToSQL generates the UPDATE SQL. (stub implementation)

func (*UpdateBuilder) Where

func (u *UpdateBuilder) Where(condition string) *UpdateBuilder

Where adds a WHERE condition.

Jump to

Keyboard shortcuts

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