Documentation ¶
Index ¶
- Variables
- func NewCollectionWith(stmt *query.CreateTable) (document.Schema, error)
- func NewDataTypeFrom(elemType document.ElementType) (query.DataType, error)
- func NewElementTypeFrom(sqlType query.DataType) (document.ElementType, error)
- func NewElementWith(col *query.Column) (document.Element, error)
- func NewIndexWith(s document.Schema, def *query.Index) (document.Index, error)
- func NewKeyFromCond(dbName string, schema document.Schema, cond *query.Condition) (store.Key, document.IndexType, error)
- func NewKeyFromIndex(dbName string, schema document.Schema, idx document.Index, ...) (store.Key, error)
- func NewKeyFromObject(dbName string, schema document.Schema, obj document.MapObject) (store.Key, error)
- func NewKeyWith(dbName string, tblName string, keyName string, val any) (store.Key, error)
- func NewLimitWith(limit *query.Limit) []store.Option
- func NewObjectFromInsert(dbName string, schema document.Schema, stmt *query.Insert) (document.Key, document.MapObject, error)
- func NewOrderWith(orderBy *query.OrderBy) []store.Option
- func NewPrimaryIndexWith(elem document.Element) (document.Index, error)
- type Conn
- type Service
- func (service *Service) CancelTransactionWithError(ctx context.Context, txn store.Transaction, err error) error
- func (service *Service) CreateDatabase(conn Conn, stmt *query.CreateDatabase) error
- func (service *Service) CreateIndex(conn Conn, stmt *query.CreateIndex) (message.Responses, error)
- func (service *Service) CreateTable(conn Conn, stmt *query.CreateTable) error
- func (service *Service) Delete(conn Conn, stmt *query.Delete) (int, error)
- func (service *Service) DeleteDocument(ctx context.Context, conn Conn, txn store.Transaction, schema document.Schema, ...) error
- func (service *Service) DropDatabase(conn Conn, stmt *query.DropDatabase) error
- func (service *Service) DropTable(conn Conn, stmt *query.DropTable) error
- func (service *Service) Insert(conn Conn, stmt *query.Insert) error
- func (service *Service) InsertSecondaryIndexes(ctx context.Context, conn Conn, txn store.Transaction, schema document.Schema, ...) error
- func (service *Service) RemoveSecondaryIndexes(ctx context.Context, conn Conn, txn store.Transaction, schema document.Schema, ...) error
- func (service *Service) Select(conn Conn, stmt *query.Select) (context.Context, store.Transaction, document.Collection, store.ResultSet, ...)
- func (service *Service) SelectDocumentObjects(ctx context.Context, conn Conn, txn store.Transaction, schema document.Schema, ...) (store.ResultSet, error)
- func (service *Service) Update(conn Conn, stmt *query.Update) (int, error)
- func (service *Service) UpdateDocument(ctx context.Context, conn Conn, txn store.Transaction, schema document.Schema, ...) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewCollectionWith ¶
func NewCollectionWith(stmt *query.CreateTable) (document.Schema, error)
NewCollectionWith creates a new schema from the specified schema object.
func NewDataTypeFrom ¶
func NewDataTypeFrom(elemType document.ElementType) (query.DataType, error)
func NewElementTypeFrom ¶
func NewElementTypeFrom(sqlType query.DataType) (document.ElementType, error)
nolint: exhaustive
func NewElementWith ¶
NewElementWith returns a new element with the specified column.
func NewIndexWith ¶
NewIndexWith creates an index from the specified coulumn definition.
func NewKeyFromCond ¶
func NewKeyFromCond(dbName string, schema document.Schema, cond *query.Condition) (store.Key, document.IndexType, error)
NewKeyFromCond returns a key for the specified condition.
func NewKeyFromIndex ¶
func NewKeyFromIndex(dbName string, schema document.Schema, idx document.Index, objMap document.MapObject) (store.Key, error)
NewKeyFromIndex returns a key for the specified index.
func NewKeyFromObject ¶
func NewKeyFromObject(dbName string, schema document.Schema, obj document.MapObject) (store.Key, error)
NewKeyFromObject returns a key from the specified object.
func NewKeyWith ¶
NewKeyWith returns a key from the specified parameters.
func NewLimitWith ¶
NewLimitWith returns a new store option with the specified limit option.
func NewObjectFromInsert ¶
func NewObjectFromInsert(dbName string, schema document.Schema, stmt *query.Insert) (document.Key, document.MapObject, error)
NewObjectFromInsert returns a new object from the specified schema and columns.
func NewOrderWith ¶
NewOrderWith returns a new store option with the specified orderby option.
Types ¶
type Service ¶
type Service struct {
*plugins.BaseService
}
Service represents a new SQL service instance.
func (*Service) CancelTransactionWithError ¶
func (service *Service) CancelTransactionWithError(ctx context.Context, txn store.Transaction, err error) error
CancelTransactionWithError cancels the specified transaction with the specified error.
func (*Service) CreateDatabase ¶
func (service *Service) CreateDatabase(conn Conn, stmt *query.CreateDatabase) error
CreateDatabase handles a CREATE DATABASE query.
func (*Service) CreateIndex ¶
CreateIndex handles a CREATE INDEX query.
func (*Service) CreateTable ¶
func (service *Service) CreateTable(conn Conn, stmt *query.CreateTable) error
CreateTable handles a CREATE TABLE query.
func (*Service) DeleteDocument ¶
func (service *Service) DeleteDocument(ctx context.Context, conn Conn, txn store.Transaction, schema document.Schema, docKey document.Key) error
DeleteDocument deletes the specified object.
func (*Service) DropDatabase ¶
func (service *Service) DropDatabase(conn Conn, stmt *query.DropDatabase) error
DropDatabase handles a DROP DATABASE query.
func (*Service) InsertSecondaryIndexes ¶
func (service *Service) InsertSecondaryIndexes(ctx context.Context, conn Conn, txn store.Transaction, schema document.Schema, obj document.MapObject, prKey document.Key) error
InsertSecondaryIndexes inserts secondary indexes for the specified object.
func (*Service) RemoveSecondaryIndexes ¶
func (service *Service) RemoveSecondaryIndexes(ctx context.Context, conn Conn, txn store.Transaction, schema document.Schema, obj document.MapObject) error
RemoveSecondaryIndexes removes secondary indexes for the specified object.
func (*Service) Select ¶
func (service *Service) Select(conn Conn, stmt *query.Select) (context.Context, store.Transaction, document.Collection, store.ResultSet, error)
Select handles a SELECT query.
func (*Service) SelectDocumentObjects ¶
func (service *Service) SelectDocumentObjects(ctx context.Context, conn Conn, txn store.Transaction, schema document.Schema, cond *query.Condition, orderby *query.OrderBy, limit *query.Limit) (store.ResultSet, error)
SelectDatabaseObjects returns a result set of the specified database objects.
func (*Service) UpdateDocument ¶
func (service *Service) UpdateDocument(ctx context.Context, conn Conn, txn store.Transaction, schema document.Schema, obj any, updateCols query.ColumnList) error
UpdateDocument updates the specified object.