⚡️ DuGoPG

Installation

go get -u github.com/durudex/dugopg

Example

import (
    "context"

    "github.com/durudex/dugopg"
)

var ctx = context.Background()

func main() {
    // Creating a new postgres connection.
    conn, err := dugopg.NewConn(dugopg.ConnConfig{
        URL: "postgres://localhost:1",
    })
    if err != nil {
        ...
    }

    // Execute creating table schema.
	_, err := psql.Exec(ctx, `CREATE TABLE IF NOT EXISTS "test" (
		"id"   SERIAL       NOT NULL UNIQUE,
		"text" VARCHAR(100) NOT NULL
	);`)
	if err != nil {
		...
	}
}

⚠️ License

Copyright © 2022 Durudex. Released under the MIT license.

Third-party library licenses

GitHub

View Github