bolt

package
v0.0.0-...-260b785 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bolt

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

Bolt holds the bolt session

func Init

func Init(enabled bool, connection, bucketName string) (b *Bolt, err error)

Init initialises a new bolt instance

func (*Bolt) Aggregate

func (b *Bolt) Aggregate(ctx context.Context, col string, req *model.AggregateRequest) (interface{}, error)

Aggregate performs a bolt db pipeline aggregation

func (*Bolt) Batch

func (b *Bolt) Batch(ctx context.Context, req *model.BatchRequest) ([]int64, error)

Batch performs the provided operations in a single Batch

func (*Bolt) Close

func (b *Bolt) Close() error

Close gracefully the Bolt client

func (*Bolt) Create

func (b *Bolt) Create(ctx context.Context, col string, req *model.CreateRequest) (int64, error)

Create inserts a document (or multiple when op is "all") into the database

func (*Bolt) CreateDatabaseIfNotExist

func (b *Bolt) CreateDatabaseIfNotExist(ctx context.Context, project string) error

CreateDatabaseIfNotExist creates a project if none exist

func (*Bolt) Delete

func (b *Bolt) Delete(ctx context.Context, col string, req *model.DeleteRequest) (int64, error)

Delete deletes a document (or multiple when op is "all") from the database

func (*Bolt) DeleteCollection

func (b *Bolt) DeleteCollection(ctx context.Context, col string) error

DeleteCollection deletes collection / tables name of specified database

func (*Bolt) DescribeTable

func (b *Bolt) DescribeTable(ctx context.Context, col string) ([]model.InspectorFieldType, []model.IndexType, error)

DescribeTable return a structure of sql table

func (*Bolt) GetCollections

func (b *Bolt) GetCollections(ctx context.Context) ([]utils.DatabaseCollections, error)

GetCollections returns collection / tables name of specified database

func (*Bolt) GetConnectionState

func (b *Bolt) GetConnectionState(ctx context.Context) bool

GetConnectionState : function to check connection state

func (*Bolt) GetDBType

func (b *Bolt) GetDBType() model.DBType

GetDBType returns the dbType of the crud block

func (*Bolt) IsClientSafe

func (b *Bolt) IsClientSafe(ctx context.Context) error

IsClientSafe checks whether database is enabled and connected

func (*Bolt) IsSame

func (b *Bolt) IsSame(conn, dbName string, driverConf config.DriverConfig) bool

IsSame checks if we've got the same connection string

func (*Bolt) RawBatch

func (b *Bolt) RawBatch(ctx context.Context, batchedQueries []string) error

RawBatch performs a batch operation for schema creation NOTE: not to be exposed externally

func (*Bolt) RawQuery

func (b *Bolt) RawQuery(ctx context.Context, query string, isDebug bool, args []interface{}) (int64, interface{}, *model.SQLMetaData, error)

RawQuery query document(s) from the database

func (*Bolt) Read

func (b *Bolt) Read(ctx context.Context, col string, req *model.ReadRequest) (int64, interface{}, map[string]map[string]string, *model.SQLMetaData, error)

func (*Bolt) SetProjectAESKey

func (b *Bolt) SetProjectAESKey(aesKey []byte)

SetProjectAESKey sets aes key

func (*Bolt) SetQueryFetchLimit

func (b *Bolt) SetQueryFetchLimit(limit int64)

SetQueryFetchLimit sets data fetch limit

func (*Bolt) Update

func (b *Bolt) Update(ctx context.Context, col string, req *model.UpdateRequest) (int64, error)

Update updates the document(s) which match the condition provided.

Jump to

Keyboard shortcuts

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