db

package
v0.0.0-...-fdfdc31 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountData

func CountData(queryStr string, openedDB *sql.DB) (int, error)

func Merge

func Merge(fromData []Schema, to *sql.DB) error

Types

type Data

type Data struct {
	Driver     string
	DbUser     string
	DbPassword string
	DbName     string
}

Data is a struct which pass into Connect function.

func (Data) Connect

func (d Data) Connect() (db *sql.DB, err error)

Connect () (db *sql.DB, err error) Function that extends struct LisaDBSchema which extends main model. It returns lisaDb no matter if error occured. Please check always if error is equal nil.

func (Data) ToString

func (d Data) ToString() string

ToString () returns a string in connection format. See above.

type Schema

type Schema struct {
	CustomerNumber         uint16
	CustomerName           string
	ContactLastName        string
	ContactFirstName       string
	Phone                  string
	AddressLine1           string
	AddressLine2           string
	City                   string
	State                  string
	PostalCode             string
	Country                string
	SalesRepEmployeeNumber int
	CreditLimit            float32
}

Schema of database, which is the same for Zen and Lisa.

func GetData

func GetData(openedDB *sql.DB) ([]Schema, error)

Jump to

Keyboard shortcuts

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