Documentation ¶
Index ¶
- func DoQuery(ctx context.Context, db *sql.DB, query string, colAddrs []ColAddr, ...) ([]record.Record, error)
- func DoStreamQuery(ctx context.Context, db *sql.DB, query string, colAddrs []ColAddr, ...) (stream.ClientStream, error)
- type ColAddr
- type Storage
- func (s *Storage) AddCollection(ctx context.Context, db *metadata.Database, ...) error
- func (s *Storage) AddCollectionField(ctx context.Context, db *metadata.Database, ...) error
- func (s *Storage) AddCollectionIndex(ctx context.Context, db *metadata.Database, ...) error
- func (s *Storage) AddDatabase(ctx context.Context, db *metadata.Database) error
- func (s *Storage) AddShardInstance(ctx context.Context, db *metadata.Database, ...) error
- func (s *Storage) Aggregate(ctx context.Context, args query.QueryArgs) *query.Result
- func (s *Storage) Delete(ctx context.Context, args query.QueryArgs) *query.Result
- func (s *Storage) Filter(ctx context.Context, args query.QueryArgs) *query.Result
- func (s *Storage) FilterStream(ctx context.Context, args query.QueryArgs) *query.ResultStream
- func (s *Storage) Get(ctx context.Context, args query.QueryArgs) *query.Result
- func (s *Storage) GetCollection(ctx context.Context, dbname, shardinstance, collectionname string) *metadata.Collection
- func (s *Storage) GetCollectionField(ctx context.Context, dbname, shardinstance, collectionname, fieldname string) *metadata.CollectionField
- func (s *Storage) GetCollectionIndex(ctx context.Context, dbname, shardinstance, collectionname, indexname string) *metadata.CollectionIndex
- func (s *Storage) GetDatabase(ctx context.Context, dbname string) *metadata.Database
- func (s *Storage) GetMeta() *metadata.Meta
- func (s *Storage) GetShardInstance(ctx context.Context, dbname, shardinstance string) *metadata.ShardInstance
- func (s *Storage) Init(metaFunc metadata.MetaFunc, c map[string]interface{}) error
- func (s *Storage) Insert(ctx context.Context, args query.QueryArgs) *query.Result
- func (s *Storage) InsertMany(ctx context.Context, args query.QueryArgs) *query.Result
- func (s *Storage) ListCollection(ctx context.Context, dbname, shardinstance string) []*metadata.Collection
- func (s *Storage) ListCollectionField(ctx context.Context, dbname, shardinstance, collectionname string) []*metadata.CollectionField
- func (s *Storage) ListCollectionIndex(ctx context.Context, dbname, shardInstance, collectionname string) []*metadata.CollectionIndex
- func (s *Storage) ListDatabase(ctx context.Context) []*metadata.Database
- func (s *Storage) ListShardInstance(ctx context.Context, dbname string) []*metadata.ShardInstance
- func (s *Storage) RemoveCollection(ctx context.Context, dbname, shardinstance, collectionname string) error
- func (s *Storage) RemoveCollectionField(ctx context.Context, dbname, shardinstance, collectionname, fieldName string) error
- func (s *Storage) RemoveCollectionIndex(ctx context.Context, dbname, shardinstance, collectionname, indexname string) error
- func (s *Storage) RemoveDatabase(ctx context.Context, dbname string) error
- func (s *Storage) RemoveShardInstance(ctx context.Context, dbname, shardInstance string) error
- func (s *Storage) Set(ctx context.Context, args query.QueryArgs) *query.Result
- func (s *Storage) Update(ctx context.Context, args query.QueryArgs) *query.Result
- type StorageConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ColAddr ¶
type ColAddr struct {
// contains filtered or unexported fields
}
ColAddr is a list of addresses of columns
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func (*Storage) AddCollection ¶
func (s *Storage) AddCollection(ctx context.Context, db *metadata.Database, shardInstance *metadata.ShardInstance, collection *metadata.Collection) error
Collection Changes
func (*Storage) AddCollectionField ¶
func (s *Storage) AddCollectionField(ctx context.Context, db *metadata.Database, shardinstance *metadata.ShardInstance, collection *metadata.Collection, field *metadata.CollectionField) error
CONSTRAINT collection_field_parent_collection_field_id_fkey FOREIGN KEY (parent_collection_field_id)
REFERENCES public.collection_field (_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION
func (*Storage) AddCollectionIndex ¶
func (s *Storage) AddCollectionIndex(ctx context.Context, db *metadata.Database, shardInstance *metadata.ShardInstance, collection *metadata.Collection, index *metadata.CollectionIndex) error
Index changes
func (*Storage) AddDatabase ¶
Database changes
func (*Storage) AddShardInstance ¶
func (*Storage) FilterStream ¶
TODO: combine filter & filterStream query generation (they are literally a copy/paste up until the actual query execution)
func (*Storage) GetCollection ¶
func (*Storage) GetCollectionField ¶
func (s *Storage) GetCollectionField(ctx context.Context, dbname, shardinstance, collectionname, fieldname string) *metadata.CollectionField
TODO: better
func (*Storage) GetCollectionIndex ¶
func (*Storage) GetDatabase ¶
func (*Storage) GetShardInstance ¶
func (*Storage) InsertMany ¶
func (*Storage) ListCollection ¶
func (s *Storage) ListCollection(ctx context.Context, dbname, shardinstance string) []*metadata.Collection
TODO: nicer, this works but is way more work than necessary
func (*Storage) ListCollectionField ¶
func (*Storage) ListCollectionIndex ¶
func (*Storage) ListDatabase ¶
func (*Storage) ListShardInstance ¶
func (*Storage) RemoveCollection ¶
func (s *Storage) RemoveCollection(ctx context.Context, dbname, shardinstance, collectionname string) error
TODO: use db listing to remove things TODO: remove indexes on removal
func (*Storage) RemoveCollectionField ¶
func (*Storage) RemoveCollectionIndex ¶
func (s *Storage) RemoveCollectionIndex(ctx context.Context, dbname, shardinstance, collectionname, indexname string) error
TODO: index names have to be unique across the whole DB?
func (*Storage) RemoveDatabase ¶
func (*Storage) RemoveShardInstance ¶
Click to show internal directories.
Click to hide internal directories.