nosqldrivers

package
v0.3.36 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ArangoConst = struct {
		KeyFieldName string
		IndexPersist string
		IndexGeo     string
		IndexGeoJson string
	}{
		KeyFieldName: "_key",
		IndexPersist: "persist",
		IndexGeo:     "geo",
		IndexGeoJson: "geojson",
	}
)

Functions

This section is empty.

Types

type DriverArango

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

func NewDriverArango

func NewDriverArango(dsn *NoSqlDsn) (*DriverArango, error)

func (*DriverArango) Close

func (instance *DriverArango) Close() error

func (*DriverArango) Collection

func (instance *DriverArango) Collection(name string, createIfDoesNotExists bool) (INoSqlCollection, error)

func (*DriverArango) Count

func (instance *DriverArango) Count(query string, bindVars map[string]interface{}) (int64, error)

func (*DriverArango) Delete

func (instance *DriverArango) Delete(collectionName string, item interface{}) (map[string]interface{}, error)

func (*DriverArango) Exec

func (instance *DriverArango) Exec(query string, bindVars map[string]interface{}) (interface{}, error)

func (*DriverArango) Insert

func (instance *DriverArango) Insert(collectionName string, item map[string]interface{}) (map[string]interface{}, error)

func (*DriverArango) Query

func (instance *DriverArango) Query(query string, bindVars map[string]interface{}) ([]interface{}, error)

func (*DriverArango) Update

func (instance *DriverArango) Update(collectionName string, item map[string]interface{}) (map[string]interface{}, error)

func (*DriverArango) Upsert

func (instance *DriverArango) Upsert(collectionName string, item map[string]interface{}) (map[string]interface{}, error)

type DriverArangoCollection

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

func (*DriverArangoCollection) EnsureIndex

func (instance *DriverArangoCollection) EnsureIndex(typeName string, fields []string, unique bool) (bool, error)

func (*DriverArangoCollection) Name

func (instance *DriverArangoCollection) Name() string

func (*DriverArangoCollection) RemoveIndex

func (instance *DriverArangoCollection) RemoveIndex(typeName string, fields []string) (bool, error)

type INoSqlCollection

type INoSqlCollection interface {
	Name() string
	RemoveIndex(typeName string, fields []string) (bool, error)
	EnsureIndex(typeName string, fields []string, unique bool) (bool, error)
}

type INoSqlDatabase

type INoSqlDatabase interface {
	Close() error
	Query(query string, bindVars map[string]interface{}) ([]interface{}, error)
	Exec(query string, bindVars map[string]interface{}) (interface{}, error)
	Count(query string, bindVars map[string]interface{}) (int64, error)
	Insert(collectionName string, item map[string]interface{}) (map[string]interface{}, error)
	Update(collectionName string, item map[string]interface{}) (map[string]interface{}, error)
	Upsert(collectionName string, item map[string]interface{}) (map[string]interface{}, error)
	Delete(collectionName string, item interface{}) (map[string]interface{}, error)

	Collection(name string, createIfNotExists bool) (INoSqlCollection, error)
}

func NewDatabase

func NewDatabase(driverName, connectionString string) (driver INoSqlDatabase, err error)

type NoSqlDsn

type NoSqlDsn struct {
	User     string
	Password string
	Protocol string
	Host     string
	Port     int
	Database string
}

"admin:xxxxxxxxx@tcp(localhost:3306)/test"

func NewNoSqlDsn

func NewNoSqlDsn(dsn ...string) *NoSqlDsn

func (*NoSqlDsn) GoString

func (instance *NoSqlDsn) GoString() string

func (*NoSqlDsn) String

func (instance *NoSqlDsn) String() string

String return dsn string. i.e. "admin:xxxxxxxx@tcp(localhost:3306)/test"

Jump to

Keyboard shortcuts

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