dblib

package module
v0.0.0-...-82cdbcf Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: GPL-3.0 Imports: 12 Imported by: 1

Documentation

Overview

Package dblib collection of db func

Package dblib collection of db func

Index

Constants

This section is empty.

Variables

View Source
var TestData string

TestData directory for working files

View Source
var TestDir string

TestDir working dir for tests

Functions

func DBConnect

func DBConnect(driver string, source string, timeout int) (db *sql.DB, err error)

DBConnect connect to a database using connect string

func GetDefaultDomain

func GetDefaultDomain(path string) (domain string)

GetDefaultDomain extract names_default_domain from sqlnet.ora

func HaveOerr

func HaveOerr(err error) (isOerr bool, code int, msg string)

HaveOerr checks if there is an oracle error

func SelectOneStringValue

func SelectOneStringValue(db *sql.DB, sql string) (queryResult string, err error)

SelectOneStringValue Select a single string

Types

type TNSEntries

type TNSEntries map[string]TNSEntry

TNSEntries Map of tns entries

func GetTnsnames

func GetTnsnames(filename string, recursiv bool) (TNSEntries, string, error)

GetTnsnames map tnsnames.ora entries to an readable structure

type TNSEntry

type TNSEntry struct {
	Name    string
	Desc    string
	File    string
	Service string
	Servers []address
}

TNSEntry structure for holding one entry from tnsnames.ora

func GetEntry

func GetEntry(alias string, entries TNSEntries, domain string) (e TNSEntry, ok bool)

GetEntry matches given string to tns entries using with domain part and without

Jump to

Keyboard shortcuts

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