queryexecution

package module
v0.0.0-...-e211119 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

README

Query Execution Package

This is the package used by the query service to execute queries on the database.

Executor Interface

Any new executor needs to implement the Executor interface in interface.go.

Creating an Executor

import "git.science.uu.nl/datastrophe/query-execution/arangodb"

arangodbService := arangodb.NewService()

Executing a Query

queryResult, err := arangodbService.ExecuteQuery(query string, databaseUsername string, databasePassword string, databaseHost string, databasePort int, internalDatabase string)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	ExecuteQuery(query string, databaseInfo *models.DBConnectionModel) (*[]byte, error)
}

An Executor executes queries on a database

type MockService

type MockService struct {
	// contains filtered or unexported fields
}

A MockService implements the Executor interface (mock)

func NewMockService

func NewMockService() *MockService

NewMockService creates a new service (mock)

Return: *Mockservice, the mock new service

func (*MockService) ExecuteQuery

func (s *MockService) ExecuteQuery(query string, databaseUsername string, databasePassword string, databaseHost string, databasePort int, internalDatabase string) (*[]byte, error)

ExecuteQuery sends the query to a database and parses the result (mock)

query: string, the query being sent
databaseUsername: string, the username of the database
databasePassword: string, the password of the database
databaseHost: string, the host of the database
databasePort: int, the port of the database
internalDatabase: string, the internal database
Return: (*[]byte, error), the query result and an error if there is one

func (*MockService) ToggleError

func (s *MockService) ToggleError()

ToggleError decides whether the convert function throws an error

Directories

Path Synopsis
usecases

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL