sql

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

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

Delete contains the methods for the delete operation

func (*Batch) Add

func (b *Batch) Add(request *Request) error

Add adds a delete request to batch

func (*Batch) Apply

func (b *Batch) Apply() (*model.Response, error)

Apply executes the operation and returns the result

type Delete

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

Delete contains the methods for the delete operation

func (*Delete) Apply

func (d *Delete) Apply() (*model.Response, error)

Apply executes the operation and returns the result

func (*Delete) Where

func (d *Delete) Where(conds ...utils.M) *Delete

Where sets the where clause for the request

type Get

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

Get contains the methods for the get operation

func (*Get) Apply

func (get *Get) Apply() (*model.Response, error)

Apply executes the operation and returns the result

func (*Get) Limit

func (get *Get) Limit(limit int) *Get

Limit limits the number of results returned

func (*Get) Select

func (get *Get) Select(sel map[string]int32) *Get

Select returns fields selectively

func (*Get) Skip

func (get *Get) Skip(skip int) *Get

Skip skips some of the result

func (*Get) Sort

func (get *Get) Sort(order map[string]int32) *Get

Sort sorts the result

func (*Get) Where

func (get *Get) Where(conds ...utils.M) *Get

Where sets the where clause for the request

type Insert

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

Insert contains the methods for the create operation

func (*Insert) Apply

func (i *Insert) Apply() (*model.Response, error)

Apply executes the operation and returns the result

func (*Insert) Doc

func (i *Insert) Doc(doc interface{}) *Insert

Doc sets the document to be inserted into the database

func (*Insert) Docs

func (i *Insert) Docs(docs interface{}) *Insert

Docs sets the documents to be inserted into the database

type Request

type Request interface {
	// contains filtered or unexported methods
}

type SQL

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

SQL is the client responsible to commuicate with the SQL crud module

func Init

func Init(db string, config *config.Config) *SQL

Init returns a SQL client object

func (*SQL) BeginBatch

func (s *SQL) BeginBatch() *Batch

BeginBatch returns a helper to fire a batch request

func (*SQL) Delete

func (s *SQL) Delete(col string) *Delete

Delete returns a helper to fire a delete all request

func (*SQL) EditProfile

func (s *SQL) EditProfile(id string, values model.ProfileParams) (*model.Response, error)

EditProfile fires a editProfile request

func (*SQL) Get

func (s *SQL) Get(col string) *Get

Get returns a helper to fire a get all request

func (*SQL) GetOne

func (s *SQL) GetOne(col string) *Get

GetOne returns a helper to fire a get one request

func (*SQL) Insert

func (s *SQL) Insert(col string) *Insert

Insert returns a helper to fire a insert request

func (*SQL) LiveQuery

func (s *SQL) LiveQuery(col string) *realtime.LiveQuery

LiveQuery returns a helper to fire a liveQuery request

func (*SQL) Profile

func (s *SQL) Profile(id string) (*model.Response, error)

Profile fires a profile request

func (*SQL) Profiles

func (s *SQL) Profiles() (*model.Response, error)

Profiles fires a profiles request

func (*SQL) SignIn

func (s *SQL) SignIn(email, password string) (*model.Response, error)

SignIn fires a signIn request

func (*SQL) SignUp

func (s *SQL) SignUp(email, name, password, role string) (*model.Response, error)

SignUp fires a signUp request

func (*SQL) Update

func (s *SQL) Update(col string) *Update

Update returns a helper to fire a update all request

type Update

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

Update contains the methods for the update operation

func (*Update) Apply

func (u *Update) Apply() (*model.Response, error)

Apply executes the operation and returns the result

func (*Update) Set

func (u *Update) Set(obj utils.M) *Update

Set the value of the provided fields in the document

func (*Update) Where

func (u *Update) Where(conds ...utils.M) *Update

Where sets the where clause for the request

Jump to

Keyboard shortcuts

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