{"id":37089239,"url":"https://github.com/letsfire/pg","last_synced_at":"2026-01-14T10:56:59.247Z","repository":{"id":57529520,"uuid":"292200851","full_name":"letsfire/pg","owner":"letsfire","description":"Golang ORM with focus on PostgreSQL features and performance","archived":false,"fork":true,"pushed_at":"2020-09-02T06:44:05.000Z","size":3033,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"v10","last_synced_at":"2024-06-21T06:14:04.679Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pg.uptrace.dev/","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"go-pg/pg","license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/letsfire.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-02T06:40:24.000Z","updated_at":"2020-09-02T06:40:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/letsfire/pg","commit_stats":null,"previous_names":[],"tags_count":100,"template":false,"template_full_name":null,"purl":"pkg:github/letsfire/pg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsfire%2Fpg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsfire%2Fpg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsfire%2Fpg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsfire%2Fpg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/letsfire","download_url":"https://codeload.github.com/letsfire/pg/tar.gz/refs/heads/v10","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsfire%2Fpg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28417775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T10:56:58.439Z","updated_at":"2026-01-14T10:56:59.238Z","avatar_url":"https://github.com/letsfire.png","language":null,"readme":"# PostgreSQL client and ORM for Golang\n\n[![Build Status](https://travis-ci.org/go-pg/pg.svg?branch=v10)](https://travis-ci.org/go-pg/pg)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/go-pg/pg/v10)](https://pkg.go.dev/github.com/go-pg/pg/v10)\n\n\u003e :heart: [**Uptrace.dev** - distributed traces, logs, and errors](https://uptrace.dev)\n\n- [Docs](https://pg.uptrace.dev)\n- [Reference](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc)\n- [Examples](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#pkg-examples)\n- [RealWorld example app](https://github.com/uptrace/go-realworld-example-app)\n\n## Ecosystem\n\n- Migrations by [vmihailenco](https://github.com/go-pg/migrations) and\n  [robinjoseph08](https://github.com/robinjoseph08/go-pg-migrations).\n- [Sharding](https://github.com/go-pg/sharding).\n- [Model generator from SQL tables](https://github.com/dizzyfool/genna).\n- [urlstruct](https://github.com/go-pg/urlstruct) to decode `url.Values` into structs.\n\n## Features\n\n- Basic types: integers, floats, string, bool, time.Time, net.IP, net.IPNet.\n- sql.NullBool, sql.NullString, sql.NullInt64, sql.NullFloat64 and\n  [pg.NullTime](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#NullTime).\n- [sql.Scanner](http://golang.org/pkg/database/sql/#Scanner) and\n  [sql/driver.Valuer](http://golang.org/pkg/database/sql/driver/#Valuer) interfaces.\n- Structs, maps and arrays are marshalled as JSON by default.\n- PostgreSQL multidimensional Arrays using\n  [array tag](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Model-PostgresArrayStructTag)\n  and [Array wrapper](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-Array).\n- Hstore using\n  [hstore tag](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Model-HstoreStructTag)\n  and [Hstore wrapper](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-Hstore).\n- [Composite types](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Model-CompositeType).\n- All struct fields are nullable by default and zero values (empty string, 0, zero time, empty map\n  or slice, nil ptr) are marshalled as SQL `NULL`. `pg:\",notnull\"` is used to add SQL `NOT NULL`\n  constraint and `pg:\",use_zero\"` to allow Go zero values.\n- [Transactions](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Begin).\n- [Prepared statements](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Prepare).\n- [Notifications](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-Listener) using\n  `LISTEN` and `NOTIFY`.\n- [Copying data](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-CopyFrom) using\n  `COPY FROM` and `COPY TO`.\n- [Timeouts](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#Options) and canceling queries using\n  context.Context.\n- Automatic connection pooling with\n  [circuit breaker](https://en.wikipedia.org/wiki/Circuit_breaker_design_pattern) support.\n- Queries retry on network errors.\n- Working with models using\n  [ORM](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Model) and\n  [SQL](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Query).\n- Scanning variables using\n  [ORM](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Select-SomeColumnsIntoVars)\n  and [SQL](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-Scan).\n- [SelectOrInsert](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Insert-SelectOrInsert)\n  using on-conflict.\n- [INSERT ... ON CONFLICT DO UPDATE](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Insert-OnConflictDoUpdate)\n  using ORM.\n- Bulk/batch\n  [inserts](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Insert-BulkInsert),\n  [updates](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Update-BulkUpdate), and\n  [deletes](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Delete-BulkDelete).\n- Common table expressions using\n  [WITH](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Select-With) and\n  [WrapWith](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Select-WrapWith).\n- [CountEstimate](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Model-CountEstimate)\n  using `EXPLAIN` to get\n  [estimated number of matching rows](https://wiki.postgresql.org/wiki/Count_estimate).\n- ORM supports\n  [has one](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Model-HasOne),\n  [belongs to](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Model-BelongsTo),\n  [has many](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Model-HasMany), and\n  [many to many](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Model-ManyToMany)\n  with composite/multi-column primary keys.\n- [Soft deletes](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Model-SoftDelete).\n- [Creating tables from structs](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-CreateTable).\n- [ForEach](https://pkg.go.dev/github.com/go-pg/pg/v10?tab=doc#example-DB-Model-ForEach) that calls\n  a function for each row returned by the query without loading all rows into the memory.\n- Works with PgBouncer in transaction pooling mode.\n\n## See also\n\n- [Golang msgpack](https://github.com/vmihailenco/msgpack)\n- [Golang message task queue](https://github.com/vmihailenco/taskq)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsfire%2Fpg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fletsfire%2Fpg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsfire%2Fpg/lists"}