Documentation ¶
Overview ¶
Package sqldb contains a very primitive SQL builder.
Index ¶
- type Dialect
- type SQL
- func (s *SQL) Add(strs ...string) *SQL
- func (s *SQL) Build() (string, []any)
- func (s *SQL) Join(sep string, strs ...string) *SQL
- func (s *SQL) JoinParams(sep string, ps ...any) *SQL
- func (s *SQL) Param(p any) *SQL
- func (s *SQL) Params() []any
- func (s *SQL) RemoveLast() *SQL
- func (s *SQL) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dialect ¶
type Dialect interface { // ProcessParam takes a parameter and its index in the list of all parameters // and returns a parameter placeholder for an SQL string // and the parameter itself in an appropriate form. ProcessParam(p any, number int) (string, any) }
Dialect is used by an SQL to handle cases specific to a concrete database system.
type SQL ¶
type SQL struct {
// contains filtered or unexported fields
}
SQL is a builder of SQL queries.
func (*SQL) JoinParams ¶
JoinParams appends escaped parameters joined by a separator to an SQL query.
func (*SQL) RemoveLast ¶
RemoveLast removes the last string appended to an SQL query.
Click to show internal directories.
Click to hide internal directories.