postgres

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package postgres contains generic utilities for dealing with Postgres Databases. Directly compatible with AWS RDS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertIntoDatabase

func InsertIntoDatabase(db *gorm.DB, ptrToInsert interface{}) error

InsertIntoDatabase uses a given DB connection to insert a pointer into a database. Uses the type of the passed pointer to automigrate the schema and insert it into the database.

func OpenPostgresConnection

func OpenPostgresConnection(connString string) (*gorm.DB, error)

OpenPostgresConnection opens a postgres connection using the SQL ORM library Gorm. Example connString format: postgresql://localhost:5432/denver_replica?sslmode=disable

func QueryAllFromDatabase

func QueryAllFromDatabase(db *gorm.DB, desiredStruct interface{})

QueryAllFromDatabase uses a given DB connection to query all of type desiredStruct from the database. Expects a slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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