pgext

package module
v0.0.0-...-154a951 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: MIT Imports: 5 Imported by: 0

README

pgext : pgx and pgtype extension

This module provides a simple concrete struct, pgext.Puint, which has the expected pgx encoding and decoding methods.

This concrete struct is simply a uint64, however it includes the pgx encoding and decoding methods to be stored in a numeric postgres field.

While it is true that postgres does not have a uint64 type, this module asserts that pgext.Puint will be stored and loaded from a numeric(20,0) column type. The module will work with this definition alone, but it is recommended that a new domain is created in the postgres database. For example,

CREATE DOMAIN uint64 AS numeric(20,0) NOT NULL CHECK(0 <= VALUE AND VALUE <= 18446744073709551615);

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Puint

type Puint uint64

func (*Puint) DecodeBinary

func (p *Puint) DecodeBinary(ci *pgtype.ConnInfo, src []byte) error

func (*Puint) DecodeText

func (p *Puint) DecodeText(ci *pgtype.ConnInfo, src []byte) error

func (Puint) EncodeBinary

func (p Puint) EncodeBinary(ci *pgtype.ConnInfo, buf []byte) (newBuf []byte, err error)

func (Puint) EncodeText

func (p Puint) EncodeText(ci *pgtype.ConnInfo, buf []byte) (newBuf []byte, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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