Documentation ¶
Overview ¶
nolint:gocognit
Index ¶
- Variables
- func NewAlterAddIndexSchemaWith(schema document.Schema, addIndex query.Index) (document.Schema, error)
- func NewDocumentElementFrom(col query.Column) (document.Element, error)
- func NewDocumentElementTypeFrom(sqlType query.DataType) (document.ElementType, error)
- func NewDocumentIndexFrom(s document.Schema, def query.Index) (document.Index, error)
- func NewDocumentIndexTypeFrom(idxType query.IndexType) (document.IndexType, error)
- func NewDocumentKeyForSchema(dbName string, schema document.Schema, colName string, colVal any) (document.Key, error)
- func NewDocumentKeyFromCond(dbName string, schema document.Schema, cond query.Condition) (document.Key, document.IndexType, error)
- func NewDocumentKeyFromIndexes(dbName string, colName string, objMap document.MapObject, ...) (document.Key, error)
- func NewDocumentKeyFromObject(dbName string, schema document.Schema, obj document.MapObject) (document.Key, error)
- func NewDocumentObjectFromInsert(dbName string, schema document.Schema, stmt sql.Insert) (document.Key, document.MapObject, error)
- func NewDocumentPrimaryIndexFrom(elem document.Element) (document.Index, error)
- func NewDocumentSchemaFrom(stmt sql.CreateTable) (document.Schema, error)
- func NewLimitWith(limit query.Limit) []store.Option
- func NewOrderWith(orderBy query.OrderBy) []store.Option
- func NewQueryColumnFrom(elem document.Element) (query.Column, error)
- func NewQueryDataTypeFrom(elemType document.ElementType) (query.DataType, error)
- func NewQuerySchemaFrom(doc document.Schema) (query.Schema, error)
- func NewResultSetFrom(storeDB store.Database, storeCol store.Collection, storeRs store.ResultSet) (sql.ResultSet, error)
- func NewRowFromObject(schema resultset.Schema, obj document.Object) (resultset.Row, error)
- type Conn
- type ConnectionMap
- type Database
- type DatabaseMap
- type Service
- func (service *Service) AlterDatabase(conn Conn, stmt sql.AlterDatabase) error
- func (service *Service) AlterTable(conn Conn, stmt sql.AlterTable) error
- func (service *Service) Begin(conn Conn, stmt sql.Begin) error
- func (service *Service) CancelTransaction(ctx context.Context, conn Conn, db store.Database, txn store.Transaction) error
- func (service *Service) CancelTransactionWithError(ctx context.Context, conn Conn, db store.Database, txn store.Transaction, ...) error
- func (service *Service) Commit(conn Conn, stmt sql.Commit) error
- func (service *Service) CommitTransaction(ctx context.Context, conn Conn, db store.Database, txn store.Transaction) error
- func (service *Service) CreateDatabase(conn Conn, stmt sql.CreateDatabase) error
- func (service *Service) CreateTable(conn Conn, stmt sql.CreateTable) error
- func (service *Service) Delete(conn Conn, stmt sql.Delete) (sql.ResultSet, error)
- func (service *Service) DeleteDocument(ctx context.Context, conn Conn, txn store.Transaction, schema document.Schema, ...) error
- func (service *Service) DropDatabase(conn Conn, stmt sql.DropDatabase) error
- func (service *Service) DropTable(conn Conn, stmt sql.DropTable) error
- func (service *Service) Insert(conn Conn, stmt sql.Insert) error
- func (service *Service) InsertSecondaryIndexes(ctx context.Context, conn Conn, txn store.Transaction, schema document.Schema, ...) error
- func (service *Service) ParserError(conn Conn, query string, err error) error
- func (service *Service) RemoveSecondaryIndexes(ctx context.Context, conn Conn, txn store.Transaction, schema document.Schema, ...) error
- func (service *Service) Rollback(conn Conn, stmt sql.Rollback) error
- func (service *Service) Select(conn Conn, stmt sql.Select) (sql.ResultSet, error)
- func (service *Service) SelectDocumentObjects(ctx context.Context, conn Conn, txn store.Transaction, schema document.Schema, ...) (store.ResultSet, error)
- func (service *Service) SystemSelect(conn Conn, stmt sql.Select) (sql.ResultSet, error)
- func (service *Service) Transact(conn Conn, db store.Database, write bool) (store.Transaction, error)
- func (service *Service) Update(conn Conn, stmt sql.Update) (sql.ResultSet, error)
- func (service *Service) UpdateObject(ctx context.Context, conn Conn, txn store.Transaction, schema document.Schema, ...) error
- func (service *Service) Use(conn Conn, stmt sql.Use) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewAlterAddIndexSchemaWith ¶ added in v1.0.3
func NewAlterAddIndexSchemaWith(schema document.Schema, addIndex query.Index) (document.Schema, error)
NewAlterAddColumnSchemaWith creates a new schema with the specified alter index.
func NewDocumentElementFrom ¶ added in v1.0.2
NewDocumentElementFrom returns a new element with the specified column.
func NewDocumentElementTypeFrom ¶ added in v1.0.2
func NewDocumentElementTypeFrom(sqlType query.DataType) (document.ElementType, error)
NewDocumentElementFrom returns a new element with the specified column.
func NewDocumentIndexFrom ¶ added in v1.0.2
NewDocumentIndexFrom creates an index from the specified coulumn definition.
func NewDocumentIndexTypeFrom ¶ added in v1.0.3
NewDocumentIndexTypeFrom creates an index type from the specified element.
func NewDocumentKeyForSchema ¶ added in v1.0.2
func NewDocumentKeyForSchema(dbName string, schema document.Schema, colName string, colVal any) (document.Key, error)
NewDocumentKeyForSchema returns a key for the specified schema.
func NewDocumentKeyFromCond ¶ added in v1.0.2
func NewDocumentKeyFromCond(dbName string, schema document.Schema, cond query.Condition) (document.Key, document.IndexType, error)
NewDocumentKeyFromCond returns a key for the specified condition.
func NewDocumentKeyFromIndexes ¶ added in v1.3.4
func NewDocumentKeyFromIndexes(dbName string, colName string, objMap document.MapObject, idxes ...document.Index) (document.Key, error)
NewDocumentKeyFromIndexes returns a key for the specified index.
func NewDocumentKeyFromObject ¶ added in v1.0.2
func NewDocumentKeyFromObject(dbName string, schema document.Schema, obj document.MapObject) (document.Key, error)
NewDocumentKeyFromObject returns a key from the specified object.
func NewDocumentObjectFromInsert ¶ added in v1.0.2
func NewDocumentObjectFromInsert(dbName string, schema document.Schema, stmt sql.Insert) (document.Key, document.MapObject, error)
NewDocumentObjectFromInsert returns a new object from the specified schema and columns.
func NewDocumentPrimaryIndexFrom ¶ added in v1.0.2
NewDocumentPrimaryIndexFrom creates an index from the specified element.
func NewDocumentSchemaFrom ¶ added in v1.0.2
func NewDocumentSchemaFrom(stmt sql.CreateTable) (document.Schema, error)
NewDocumentSchemaFrom creates a new schema from the specified schema object.
func NewLimitWith ¶
NewLimitWith returns a new store option with the specified limit option.
func NewOrderWith ¶
NewOrderWith returns a new store option with the specified orderby option.
func NewQueryColumnFrom ¶ added in v1.0.2
NewQueryColumnFrom returns a new column with the specified element.
func NewQueryDataTypeFrom ¶ added in v1.0.2
func NewQueryDataTypeFrom(elemType document.ElementType) (query.DataType, error)
NewQueryDataTypeFrom returns a new column with the specified element.
func NewQuerySchemaFrom ¶ added in v1.0.2
NewQuerySchemaFrom creates a new schema from the specified schema object.
Types ¶
type ConnectionMap ¶ added in v1.1.0
type ConnectionMap map[string]DatabaseMap
ConnectionMap represents a connection map.
func NewConnectionMap ¶ added in v1.1.0
func NewConnectionMap() ConnectionMap
NewConnection returns a new connection.
func (ConnectionMap) GetTransaction ¶ added in v1.1.0
func (connMap ConnectionMap) GetTransaction(conn Conn, db store.Database) (store.Transaction, error)
GetTransaction returns the transaction.
func (ConnectionMap) RemoveTransaction ¶ added in v1.1.0
func (connMap ConnectionMap) RemoveTransaction(conn Conn, db store.Database) error
RemoveTransaction removes the transaction.
func (ConnectionMap) SetTransaction ¶ added in v1.1.0
func (connMap ConnectionMap) SetTransaction(conn Conn, db store.Database, txn store.Transaction) error
SetTransaction sets the transaction.
type Database ¶ added in v1.1.0
type Database struct {
store.Transaction
}
Database represents a database.
type DatabaseMap ¶ added in v1.1.0
DatabaseMap represents a database map.
func NewDatabaseMap ¶ added in v1.1.0
func NewDatabaseMap() DatabaseMap
NewDatabase returns a new database.
type Service ¶
type Service struct { *plugins.BaseService ConnectionMap }
Service represents a new SQL service instance.
func (*Service) AlterDatabase ¶ added in v1.0.3
func (service *Service) AlterDatabase(conn Conn, stmt sql.AlterDatabase) error
AlterDatabase handles a ALTER DATABASE query.
func (*Service) AlterTable ¶ added in v1.0.3
func (service *Service) AlterTable(conn Conn, stmt sql.AlterTable) error
AlterTable handles a ALTER TABLE query.
func (*Service) CancelTransaction ¶ added in v1.1.0
func (service *Service) CancelTransaction(ctx context.Context, conn Conn, db store.Database, txn store.Transaction) error
CancelTransaction cancels the specified transaction.
func (*Service) CancelTransactionWithError ¶
func (service *Service) CancelTransactionWithError(ctx context.Context, conn Conn, db store.Database, txn store.Transaction, err error) error
CancelTransactionWithError cancels the specified transaction with the specified error.
func (*Service) CommitTransaction ¶ added in v1.1.0
func (service *Service) CommitTransaction(ctx context.Context, conn Conn, db store.Database, txn store.Transaction) error
CommitTransaction commits the specified transaction.
func (*Service) CreateDatabase ¶
func (service *Service) CreateDatabase(conn Conn, stmt sql.CreateDatabase) error
CreateDatabase handles a CREATE DATABASE query.
func (*Service) CreateTable ¶
func (service *Service) CreateTable(conn Conn, stmt sql.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 sql.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) ParserError ¶ added in v1.3.4
ParserError handles a parser error.
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) 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) SystemSelect ¶ added in v1.3.4
SystemSelect handles a system SELECT query.
func (*Service) Transact ¶ added in v1.1.0
func (service *Service) Transact(conn Conn, db store.Database, write bool) (store.Transaction, error)
Transact returns a transaction object.