toysql

package
v0.0.0-...-34e475e Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Config *Config

	DB *sqlx.DB
	// contains filtered or unexported fields
}

Client :

func Connect

func Connect(ctx context.Context, driver, uri string, options ...func(*Config)) *Client

Connect :

func (*Client) Close

func (c *Client) Close() error

Close :

func (*Client) Session

func (c *Client) Session(ctx context.Context) (toyquery.Session, error)

Session :

type Config

type Config struct {
	DriverName string
	URI        string
}

Config :

type ID

type ID = string // TODO : int ?

ID :

type Session

type Session struct {
	Client *Client
}

Session :

func (*Session) Close

func (s *Session) Close() error

Close :

func (*Session) Exec

func (s *Session) Exec(ctx context.Context, code string) error

Exec

func (*Session) Table

func (s *Session) Table(ctx context.Context, name string) (toyquery.Table, error)

Table :

type Table

type Table struct {
	Name string
	// contains filtered or unexported fields
}

Table :

func (*Table) Count

func (t *Table) Count(ctx context.Context, options ...func(*toyquery.QOption)) (int, error)

Count :

func (*Table) Get

func (t *Table) Get(ctx context.Context, dst interface{}, options ...func(*toyquery.QOption)) error

Get :

func (*Table) GetByID

func (t *Table) GetByID(ctx context.Context, id ID, dst interface{}) error

GetByID :

func (*Table) InsertByID

func (t *Table) InsertByID(ctx context.Context, id ID, v interface{}) error

InsertByID :

Jump to

Keyboard shortcuts

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