postgres

package
v0.0.0-...-85d8416 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2019 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConStr

func ConStr(host string, port int, user string, dbName string) string

ConStr returns a connection string when passed in parameters

Types

type Db

type Db struct {
	*sql.DB
}

Db is used for interacting with the database

func New

func New(conStr string) (*Db, error)

New makes a new database using the conStr

func (*Db) GetUser

func (d *Db) GetUser(name string) []User

GetUser is called within our user query for graphql

type User

type User struct {
	ID   int
	Name string
	Age  int
}

User struct defined for db

Jump to

Keyboard shortcuts

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