module
Version:
v0.2.5
Opens a new window with list of versions in this module.
Published: Oct 16, 2020
License: GPL-3.0
Opens a new window with license information.
README
¶
stockpile
** Current state: ALPHA **
Interface to different databases, meant to allow easy mocking through the stockpile/mock package.
Useful in two ways:
- Setup a persistance layer between data and database using the database interface
- Use the mock database to run unit tests to test only specific business code
TODO:
-
Support limit option
-
Support skip option
-
[/] Support sort option
- Int sort
- String sort
- Time sort
-
Open(ctx context.Context) error
-
Close(ctx context.Context) error
-
Insert(collection string, object interface{}) error
-
InsertMany(collection string, slice interface{}) error
-
FindOne(collection string, object interface{}, filter *Filter, opts *Options) error
-
FindAll(collection string, object interface{}, filter *Filter, opts *Options) error
-
Update(collection string, object interface{}, filter *Filter) error
-
Upsert(collection string, object interface{}, filter *Filter) error
-
Delete(collection string, filter *Filter) error
-
Search(collection, search string, fields []string, object interface{}) error
filter matching will remove underscores in field names
Directories
¶
Click to show internal directories.
Click to hide internal directories.