Documentation ¶
Index ¶
- func BaseQueryBuilder(filter map[string]interface{}, tableName, tableColumns string, ...) sq.SelectBuilder
- func GetStructColumns(someStruct interface{}) string
- func GetStructTags(model interface{}) map[string]string
- func ListSelectStatement(baseStmt sq.SelectBuilder, orderBy string, limit int64, cursor *int64, ...) (string, []interface{}, error)
- func MarshalPretty(any interface{}) ([]byte, error)
- func MarshalToBytes(any interface{}) ([]byte, error)
- func ToSnakeCase(s string) string
- func UnmarshalToMap(b []byte) (map[string]interface{}, error)
- type AllDBService
- func (a *AllDBService) Backup(ctx context.Context, in *emptypb.Empty) (*coreRpc.BackupAllResult, error)
- func (a *AllDBService) FindCoreDB(name string) *CoreDB
- func (a *AllDBService) ListBackup(ctx context.Context, in *coreRpc.ListBackupRequest) (*coreRpc.ListBackupResult, error)
- func (a *AllDBService) RegisterCoreDB(cdb *CoreDB)
- func (a *AllDBService) Restore(ctx context.Context, in *coreRpc.RestoreAllRequest) (*coreRpc.RestoreAllResult, error)
- type CoreDB
- func (c *CoreDB) BulkExec(stmtMap map[string][]interface{}) error
- func (c *CoreDB) Exec(stmt string, args ...interface{}) error
- func (c *CoreDB) MakeSchema() error
- func (c *CoreDB) Query(stmt string, args ...interface{}) (*QueryResult, error)
- func (c *CoreDB) QueryOne(stmt string, args ...interface{}) (*DocumentResult, error)
- func (c *CoreDB) RegisterCronFunction(funcSpec string, function func()) error
- func (c *CoreDB) RegisterModels(modelsMap map[string]DbModel) error
- func (c *CoreDB) SingleListBackup(ctx context.Context, in *emptypb.Empty) ([]*coreRpc.SingleBackupResult, error)
- type DbModel
- type DocumentResult
- type Error
- type ErrorReason
- type QueryParams
- type QueryResult
- type StmtIFacer
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseQueryBuilder ¶
func BaseQueryBuilder(filter map[string]interface{}, tableName, tableColumns string, sqlMatcher string) sq.SelectBuilder
func ListSelectStatement ¶
Types ¶
type AllDBService ¶
type AllDBService struct { RegisteredDBs []*CoreDB *coreRpc.UnimplementedDbAdminServiceServer }
func NewAllDBService ¶
func NewAllDBService() *AllDBService
func (*AllDBService) Backup ¶
func (a *AllDBService) Backup(ctx context.Context, in *emptypb.Empty) (*coreRpc.BackupAllResult, error)
func (*AllDBService) FindCoreDB ¶
func (a *AllDBService) FindCoreDB(name string) *CoreDB
func (*AllDBService) ListBackup ¶
func (a *AllDBService) ListBackup(ctx context.Context, in *coreRpc.ListBackupRequest) (*coreRpc.ListBackupResult, error)
func (*AllDBService) RegisterCoreDB ¶
func (a *AllDBService) RegisterCoreDB(cdb *CoreDB)
func (*AllDBService) Restore ¶
func (a *AllDBService) Restore(ctx context.Context, in *coreRpc.RestoreAllRequest) (*coreRpc.RestoreAllResult, error)
type CoreDB ¶
type CoreDB struct {
// contains filtered or unexported fields
}
CoreDB is the exported struct
func NewCoreDB ¶
NewCoreDB facilitates creation of (wrapped) genji database alongside badger DB engine if one wants to use one or the other. or if internally will use the underlying badger DB engine to create Stream for example for backup, restore, or anything
func (*CoreDB) Query ¶
func (c *CoreDB) Query(stmt string, args ...interface{}) (*QueryResult, error)
func (*CoreDB) QueryOne ¶
func (c *CoreDB) QueryOne(stmt string, args ...interface{}) (*DocumentResult, error)
func (*CoreDB) RegisterCronFunction ¶
func (*CoreDB) RegisterModels ¶
Register dao models for db
type DocumentResult ¶
func (*DocumentResult) StructScan ¶
func (d *DocumentResult) StructScan(dest interface{}) error
type Error ¶
type Error struct { Reason ErrorReason Err error }
type QueryParams ¶
type QueryParams struct {
Params map[string]interface{}
}
func AnyToQueryParam ¶
func AnyToQueryParam(m interface{}, snakeCase bool) (res QueryParams, err error)
func (*QueryParams) ColumnsAndValues ¶
func (qp *QueryParams) ColumnsAndValues() ([]string, []interface{})
Click to show internal directories.
Click to hide internal directories.