MCPcopy
hub / github.com/spacecloud-io/space-cloud / Crud

Interface Crud

gateway/modules/crud/crud.go:55–75  ·  view source on GitHub ↗

Crud abstracts the implementation crud operations of databases

Source from the content-addressed store, hash-verified

53
54// Crud abstracts the implementation crud operations of databases
55type Crud interface {
56 Create(ctx context.Context, col string, req *model.CreateRequest) (int64, error)
57 Read(ctx context.Context, col string, req *model.ReadRequest) (int64, interface{}, map[string]map[string]string, *model.SQLMetaData, error)
58 Update(ctx context.Context, col string, req *model.UpdateRequest) (int64, error)
59 Delete(ctx context.Context, col string, req *model.DeleteRequest) (int64, error)
60 Aggregate(ctx context.Context, col string, req *model.AggregateRequest) (interface{}, error)
61 Batch(ctx context.Context, req *model.BatchRequest) ([]int64, error)
62 DescribeTable(ctc context.Context, col string) ([]model.InspectorFieldType, []model.IndexType, error)
63 RawQuery(ctx context.Context, query string, isDebug bool, args []interface{}) (int64, interface{}, *model.SQLMetaData, error)
64 GetCollections(ctx context.Context) ([]utils.DatabaseCollections, error)
65 DeleteCollection(ctx context.Context, col string) error
66 CreateDatabaseIfNotExist(ctx context.Context, name string) error
67 RawBatch(ctx context.Context, batchedQueries []string) error
68 GetDBType() model.DBType
69 IsClientSafe(ctx context.Context) error
70 IsSame(conn, dbName string, driverConf config.DriverConfig) bool
71 Close() error
72 GetConnectionState(ctx context.Context) bool
73 SetQueryFetchLimit(limit int64)
74 SetProjectAESKey(aesKey []byte)
75}
76
77// Init create a new instance of the Module object
78func Init() *Module {

Callers 96

CreateProjectMethod · 0.65
CreateSecretMethod · 0.65
applyDeploymentMethod · 0.65
applyServiceMethod · 0.65
processIntentsMethod · 0.65
processStagedEventsMethod · 0.65
matchQueryMethod · 0.65
DoRealtimeSubscribeMethod · 0.65

Implementers 3

SQLgateway/modules/crud/sql/sql.go
Mongogateway/modules/crud/mgo/mongo.go
Boltgateway/modules/crud/bolt/bolt.go

Calls

no outgoing calls

Tested by

no test coverage detected