connect

package
v4.1.10+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2013 Tamás Gulácsi

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCfg

func GetCfg(dsn string) (srvCfg *ora.SrvCfg, sesCfg *ora.SesCfg)

GetDSN returns a (command-line defined) connection string

func GetConnection

func GetConnection(dsn string) (*sql.DB, error)

GetConnection returns a connection - using GetDSN if dsn is empty

func GetDSN

func GetDSN(srvCfg *ora.SrvCfg, sesCfg *ora.SesCfg) string

func GetRawConnection

func GetRawConnection(dsn string) (*ora.Ses, error)

GetRawConnection returns a raw (*ora.Ses) connection - using GetDSN if dsn is empty

func MapToSlice

func MapToSlice(qry string, metParam func(string) interface{}) (string, []interface{})

MapToSlice modifies query for map (:paramname) to :%d placeholders + slice of params.

Calls metParam for each parameter met, and returns the slice of their results.

func SplitDSN

func SplitDSN(dsn string) (username, password, sid string)

SplitDSN splits the username/password@sid string to its parts.

Copied from github.com/tgulacsi/go/orahlp/orahlp.go

Types

type Column

type Column struct {
	Schema, Name                   string
	Type, Length, Precision, Scale int
	Nullable                       bool
	CharsetID, CharsetForm         int
}

func DescribeQuery

func DescribeQuery(db dber.Execer, qry string) ([]Column, error)

DescribeQuery describes the columns in the qry string, using DBMS_SQL.PARSE + DBMS_SQL.DESCRIBE_COLUMNS2.

This can help using unknown-at-compile-time, a.k.a. dynamic queries.

type Version

type Version struct {
	// major.maintenance.application-server.component-specific.platform-specific
	Major, Maintenance, AppServer, Component, Platform int8
}

func GetVersion

func GetVersion(db dber.Queryer) (Version, error)

Jump to

Keyboard shortcuts

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