Skip to content
/ pgxx Public
forked from george-steel/pgxx

An sqlx-based warpper for use directly with pgx structures.

License

Notifications You must be signed in to change notification settings

tsingson/pgxx

This branch is up to date with george-steel/pgxx:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a51d7d1 · Mar 10, 2025

History

26 Commits
May 10, 2024
May 10, 2024
Mar 10, 2025
Mar 8, 2025
Mar 10, 2025
Mar 10, 2025
Mar 6, 2025
Mar 8, 2025
Mar 8, 2025
Mar 10, 2025
Mar 2, 2025
Mar 8, 2025
Mar 10, 2025
Mar 10, 2025
Mar 9, 2025
Jan 8, 2025
Jan 12, 2025

Repository files navigation

pgxx

Go Reference

A high-level helper for pgx where most operations are done with a single function call that takes and returns standard go and pgx types. Functionality is heavily inspired by sqlx, but uses the raw pgx interface instead of database/sql for increased efficiency and to support ACID transactions in both batched and retry-loop modes (neither of which arre supported by database/sql).

For example usage, see integration_test.go.

When scanning results and resolving named parameters, columns are mapped to struct fields tagged with db:"column_name" (fields without this tag are ignored). Additionally, to support composite fields and ad-hoc joins, a struct field can instead be tagged with db_prefix, to embed its tagged fields into the parent's mapping with a custom prefix.

In order to keep the API simple, functions based on reflection will panic on type errors (if the any parameter is not a struct or pointer-to-struct, or if it is missing the requested named parameters) unless otherwise indicated.

About

An sqlx-based warpper for use directly with pgx structures.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%