go_database_driver

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

README

go-database-driver

This library gives you the support to execute different database query engines, currently we have added support for (trino, presto, mysql, athena), all you have to do is following:-

Import this library in your project.
import "github.com/nurture-farm/go-database-driver"
import "github.com/nurture-farm/go-database-driver/driverConfig"
Initialise the drivers
trinoConfig := &driverConfig.TrinoConfig{
    Dsn: viper.GetString("trino_url"),
}
drivers.InitializeDrivers(drivers.TRINO, trinoConfig)
Call the function to execute the query with query and driver type
_, data, err := drivers.ExecuteQuery(base.QueryActiveActor, drivers.TRINO)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteQuery

func ExecuteQuery(query string, databaseClient DatabaseClient) (map[string]string, [][]interface{}, []string, error)

func InitializeDrivers

func InitializeDrivers(client DatabaseClient, config interface{}) error

Types

type DatabaseClient

type DatabaseClient int
const (
	ATHENA DatabaseClient = iota
	MYSQL
	PRESTO
	TRINO
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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