Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketFsContext ¶
type BucketFsContext interface { // ResolvePath returns an absolute path for the given filename in BucketFS. ResolvePath(fileName string) string }
BucketFsContext allows extensions to interact with BucketFS.
[impl -> dsn~extension-context-bucketfs~1].
type BucketFsContextMock ¶ added in v0.5.3
func CreateBucketFsContextMock ¶ added in v0.5.3
func CreateBucketFsContextMock() *BucketFsContextMock
func (*BucketFsContextMock) ResolvePath ¶ added in v0.5.3
func (mock *BucketFsContextMock) ResolvePath(fileName string) string
func (*BucketFsContextMock) SimulateResolvePath ¶ added in v0.5.3
func (mock *BucketFsContextMock) SimulateResolvePath(fileName string, result string)
func (*BucketFsContextMock) SimulateResolvePathPanics ¶ added in v0.5.3
func (mock *BucketFsContextMock) SimulateResolvePathPanics(fileName string, panicMessage string)
type ContextSqlClient ¶
type ExtensionContext ¶
type ExtensionContext struct { ExtensionSchemaName string `json:"extensionSchemaName"` // Name of the schema where EM creates all database objects (e.g. scripts or virtual schemas) SqlClient ContextSqlClient `json:"sqlClient"` // Allows extensions to execute SQL queries and statements BucketFs BucketFsContext `json:"bucketFs"` // Allows extensions to interact with BucketFS Metadata MetadataContext `json:"metadata"` // Allows extensions to read Exasol metadata tables }
Instances of type ExtensionContext are passed to an extension so that extension can
- retrieve context information like the extension schema name (field ExtensionSchemaName)
- execute SQL queries against the database using a [SqlClient]
- or resolve files in BucketFS using [BucketFs]
func CreateContext ¶
func CreateContext(txCtx *transaction.TransactionContext, extensionSchemaName string) *ExtensionContext
func CreateContextWithClient ¶
func CreateContextWithClient(extensionSchemaName string, txCtx *transaction.TransactionContext, client backend.SimpleSQLClient, bucketFsContext BucketFsContext, metadataReader exaMetadata.ExaMetadataReader) *ExtensionContext
type MetadataContext ¶
type MetadataContext interface { // Get a row from the SYS.EXA_ALL_SCRIPTS table for the given schema and script name. // // Returns `nil` when no script exists with the given name. // The JS runtime will convert `nil` to `null` in JavaScript code, so extensions can // check if a script was found by testing the result with `=== null`. GetScriptByName(name string) *exaMetadata.ExaScriptRow }
MetadataContext contains methods for reading Exasol metadata tables.
Click to show internal directories.
Click to hide internal directories.