sql

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	Client gorm.DB
}

Driver is a unified implementation of SQL driver of datastore

func (*Driver) Add

func (m *Driver) Add(ctx context.Context, entity datastore.Entity) error

Add data model

func (*Driver) BatchAdd

func (m *Driver) BatchAdd(ctx context.Context, entities []datastore.Entity) error

BatchAdd batch add entity, this operation has some atomicity.

func (*Driver) Count

func (m *Driver) Count(ctx context.Context, entity datastore.Entity, filterOptions *datastore.FilterOptions) (int64, error)

Count counts entities

func (*Driver) Delete

func (m *Driver) Delete(ctx context.Context, entity datastore.Entity) error

Delete delete data

func (*Driver) Get

func (m *Driver) Get(ctx context.Context, entity datastore.Entity) error

Get get data model

func (*Driver) IsExist

func (m *Driver) IsExist(ctx context.Context, entity datastore.Entity) (bool, error)

IsExist determine whether data exists.

func (*Driver) List

List list entity function

func (*Driver) Put

func (m *Driver) Put(ctx context.Context, entity datastore.Entity) error

Put update data model

Jump to

Keyboard shortcuts

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