database

package module
v0.0.0-...-7873c2a Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: MIT Imports: 8 Imported by: 0

README

database

Go library for SQL database access

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpTables

func DumpTables(list []TableData) error

DumpTables prints the specified tables to standard output stream

func GetConnection

func GetConnection(config *Config) (*sql.DB, error)

GetConnection returns a SQL database connection

func GetValue

func GetValue(pval *interface{}) string

GetValue returns a typed value from a cell reference

Types

type Config

type Config struct {
	Server   string `yaml:"server" json:"server"`
	Port     int    `yaml:"port" json:"port"`
	Username string `yaml:"username" json:"username"`
	Password string `yaml:"password" json:"password"`
	Name     string `yaml:"name" json:"name"`
}

Config struct

type TableData

type TableData struct {
	Rows    [][]interface{}
	Columns []string
}

TableData struct

func GetData

func GetData(conn *sql.DB, query string) (*TableData, error)

GetData returns data retrieved by using query with conn

Jump to

Keyboard shortcuts

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