Documentation ¶
Overview ¶
Package hanadb provides SAP HANA connection utilities.
Index ¶
- Variables
- type Pool
- func (hanaPool *Pool) CreateCollection(ctx context.Context, db, collection string) error
- func (hanaPool *Pool) CreateSchema(ctx context.Context, db string) error
- func (hanaPool *Pool) DropCollection(ctx context.Context, db, collection string) error
- func (hanaPool *Pool) DropSchema(ctx context.Context, db string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTableNotExist indicates that there is no such table. ErrTableNotExist = fmt.Errorf("collection/table does not exist") // ErrSchemaNotExist indicates that there is no such schema. ErrSchemaNotExist = fmt.Errorf("database/schema does not exist") // ErrSchemaAlreadyExist indicates that a schema already exists. ErrSchemaAlreadyExist = fmt.Errorf("database/schema already exists") // ErrCollectionAlreadyExist indicates that a collection already exists. ErrCollectionAlreadyExist = fmt.Errorf("collection/table already exists") // ErrInvalidCollectionName indicates that a collection didn't pass name checks. ErrInvalidCollectionName = fmt.Errorf("invalid FerretDB collection name") // ErrInvalidDatabaseName indicates that a database didn't pass name checks. ErrInvalidDatabaseName = fmt.Errorf("invalid FerretDB database name") )
Errors are wrapped with lazyerrors.Error, so the caller needs to use errors.Is to check the error, for example, errors.Is(err, ErrSchemaNotExist).
View Source
var Errors = map[int]error{ 259: ErrTableNotExist, 288: ErrCollectionAlreadyExist, 362: ErrSchemaNotExist, 386: ErrSchemaAlreadyExist, }
Errors from HanaDB.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
Pool represents SAP HANA concurrency-safe connection pool.
func (*Pool) CreateCollection ¶ added in v1.1.0
CreateCollection creates a new SAP HANA JSON Document Store collection.
It returns ErrAlreadyExist if collection already exist.
func (*Pool) CreateSchema ¶ added in v1.1.0
CreateSchema creates a schema in SAP HANA JSON Document Store.
func (*Pool) DropCollection ¶ added in v1.1.0
DropCollection drops collection
It returns ErrTableNotExist is collection does not exist.
Click to show internal directories.
Click to hide internal directories.