bob

package
v0.0.0-...-e934472 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

simplest package ever to put the table name in place Usage bob.Table(&User{}).Build(`SELECT * FROM :table`)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bob

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

func Table

func Table(i interface{}) *Bob

Table accepts a pointer to a struct the struct should have TableName() string method defined on it. It calls the TableName() method to get the tablename or defaults to snakecaseing

func (*Bob) Assemble

func (d *Bob) Assemble(m map[string]interface{}) string

func (*Bob) Build

func (d *Bob) Build(query string, pattern ...string) string

BuildQuery takes a string with :table template and replaces it in query

func (*Bob) BuildWithClause

func (d *Bob) BuildWithClause(query string, pattern ...string) *Bob

func (*Bob) TableName

func (d *Bob) TableName() string

type StringArray

type StringArray []string

func (*StringArray) Scan

func (v *StringArray) Scan(value interface{}) error

func (StringArray) Value

func (v StringArray) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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