Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ pgx Public
forked from jackc/pgx

PostgreSQL driver and toolkit for Go fork from pgx, add opengauss support

License

Kseleven/pgx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Reference Build Status

pgx - PostgreSQL Driver and Toolkit

pgx is a PostgreSQL Driver fork from pgx, and add opengauss sha256 sasl support.

Example Usage

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/Kseleven/pgx/v5"
)

func main() {
	// urlExample := "postgres://username:password@localhost:5432/database_name"
	conn, err := pgx.Connect(context.Background(), os.Getenv("DATABASE_URL"))
	if err != nil {
		fmt.Fprintf(os.Stderr, "Unable to connect to database: %v\n", err)
		os.Exit(1)
	}
	defer conn.Close(context.Background())

	var name string
	var weight int64
	err = conn.QueryRow(context.Background(), "select name, weight from widgets where id=$1", 42).Scan(&name, &weight)
	if err != nil {
		fmt.Fprintf(os.Stderr, "QueryRow failed: %v\n", err)
		os.Exit(1)
	}

	fmt.Println(name, weight)
}

See the getting started guide for more information.

Features

  • Same as pgx Features, See the pgx Features for more information.
  • Support opengauss password_encryption_type=2 sha256 algorithm, See the opengauss for more information.

About

PostgreSQL driver and toolkit for Go fork from pgx, add opengauss support

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 98.5%
  • HTML 1.3%
  • Other 0.2%