postgresql

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

README

gdbc-postgresql

GDBC Postgresql Driver - It is based on https://github.com/jackc/pgx

Go Report Card codecov Build Status

Usage

dataSource, err := gdbc.GetDataSource("gdbc:postgresql://username:password@localhost:3000/testdb?sslmode=disable")
if err != nil {
    panic(err)
}

var connection *sql.DB
connection, err = dataSource.GetConnection()
if err != nil {
    panic(err)
}

Postgresql GDBC URL takes one of the following forms:

gdbc:postgresql://host:port/database-name?arg1=value1
gdbc:postgresql://host/database-name?arg1=value1
gdbc:postgresql:database-name?arg1=value1
gdbc:postgresql:?arg1=value1
gdbc:postgresql://username:password@host:port/database-name?arg1=value1

Default Values:

  • Host : localhost
  • Port : 5432
  • User : postgres
  • Password :

Checkout https://github.com/jackc/pgx for arguments details.

Documentation

Index

Constants

View Source
const DefaultHost = "localhost"
View Source
const DefaultPort = "5432"
View Source
const DefaultUser = "postgres"

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresDataSourceNameAdapter

type PostgresDataSourceNameAdapter struct {
}

func (PostgresDataSourceNameAdapter) GetDataSourceName

func (dsnAdapter PostgresDataSourceNameAdapter) GetDataSourceName(dataSource gdbc.DataSource) (string, error)

Jump to

Keyboard shortcuts

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