Crud abstracts the implementation crud operations of databases
| 53 | |
| 54 | // Crud abstracts the implementation crud operations of databases |
| 55 | type 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 |
| 78 | func Init() *Module { |
no outgoing calls
no test coverage detected