connections

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MONGO = ftypes.DBTypes(1)
	MYSQL = ftypes.DBTypes(2)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection interface {
	Paginate(interface{}, ...queryoptions.FindOptions)
	RegisterSchema()
	// New methods for bulk operations.
	FindMany(interface{})
	CreateMany([]interface{})
	UpdateMany([]interface{})
	DeleteMany(ftypes.QMap)
	// contains filtered or unexported methods
}

Define an interface for query operations.

type MongoConnection

type MongoConnection interface {
	Connection

	// Deconstructs an array field and generates a separate document for each element in the array.
	Table(tableName string) MongoConnection
	Where(interface{}) MongoConnection
	Skip(skip int64) MongoConnection
	Limit(limit int64) MongoConnection
	Sort(sortKey string, sortdesc ...bool) MongoConnection
	Project(keys map[string]bool) MongoConnection
}

Define a separate interface for MongoDB-specific queries.

type SQLConnection

type SQLConnection interface {
	Connection
	ExecuteSQL(sql string, args ...interface{}) error

	Where(interface{}) SQLConnection
	Table(tableName string) SQLConnection
	GroupBy(fieldname string) SQLConnection
	Having(conditions interface{}) SQLConnection
	Skip(skip int64) SQLConnection
	Limit(limit int64) SQLConnection
	Sort(sortKey string, sortdesc ...bool) SQLConnection
	Project(keys map[string]bool) SQLConnection
	Join(join joins.Join) SQLConnection
}

Jump to

Keyboard shortcuts

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