sqlgen

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnBuilder

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

ColumnBuilder handles internal column info

func (*ColumnBuilder) Integer

func (cb *ColumnBuilder) Integer() *CreateTableBuilder

Integer sets INTEGER type to the column

func (*ColumnBuilder) VarChar

func (cb *ColumnBuilder) VarChar(size int64) *CreateTableBuilder

VarChar sets VarChar(given size) type to the column

type CreateBuilder

type CreateBuilder struct{}

CreateBuilder stands for the API of CREATE statement builder

func Create

func Create() *CreateBuilder

Create starts construction of CREATE query

func (*CreateBuilder) DB

DB says that we are CREATE-ing a DATABASE with given name

func (*CreateBuilder) Database

func (cb *CreateBuilder) Database(name string) *CreateDatabaseBuilder

Database says that we are CREATE-ing a DATABASE with given name It's an alias of (*CreateBuilder).DB

func (*CreateBuilder) Table

func (cb *CreateBuilder) Table(name string) *CreateTableBuilder

Table says that we are CREATE-ing a TABLE with given name

type CreateDatabaseBuilder

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

CreateDatabaseBuilder handles internal info about CREATE DATABASE statement that now builds

func (*CreateDatabaseBuilder) Build

func (cb *CreateDatabaseBuilder) Build() string

Build the statement

func (*CreateDatabaseBuilder) UseIt

UseIt says that we need to USE the database we just created

type CreateTableBuilder

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

CreateTableBuilder handles internal info about create table statement that now builds

func (*CreateTableBuilder) Build

func (tb *CreateTableBuilder) Build() string

Build the statement

func (*CreateTableBuilder) Column

func (tb *CreateTableBuilder) Column(name string) *ColumnBuilder

Column initialize a column builder that requires you to choose a type before you can Build the statement

type InsertBuilder

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

InsertBuilder defines internal implementation of a INSERT statement builder

func Insert

func Insert(table string) *InsertBuilder

Insert statement builder generates an insert statement using `?` placeholders for values

func PreparedInsert

func PreparedInsert(table string) *InsertBuilder

PreparedInsert statement builder generates the insert SQL statement with values built in the statement without using placeholders

func (*InsertBuilder) Build

func (b *InsertBuilder) Build() string

Build the query

func (*InsertBuilder) Columns

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

Columns defines column list

func (*InsertBuilder) Values

func (b *InsertBuilder) Values(columnValues ...interface{}) *InsertBuilder

Values appends column values to the query

Jump to

Keyboard shortcuts

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