gotosocial/vendor/github.com/uptrace/bun
kim c00cad2ceb [chore] bump dependencies (#4339)
- github.com/KimMachineGun/automemlimit v0.7.4
- github.com/miekg/dns v1.1.67
- github.com/minio/minio-go/v7 v7.0.95
- github.com/spf13/pflag v1.0.7
- github.com/tdewolff/minify/v2 v2.23.9
- github.com/uptrace/bun v1.2.15
- github.com/uptrace/bun/dialect/pgdialect v1.2.15
- github.com/uptrace/bun/dialect/sqlitedialect v1.2.15
- github.com/uptrace/bun/extra/bunotel v1.2.15
- golang.org/x/image v0.29.0
- golang.org/x/net v0.42.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4339
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-07-22 18:00:27 +02:00
..
dialect [chore] bump dependencies (#4339) 2025-07-22 18:00:27 +02:00
extra bumps our uptrace/bun dependencies to v1.2.10 (#3865) 2025-03-03 10:42:05 +00:00
internal bump uptrace/bun dependencies from 1.2.6 to 1.2.8 (#3645) 2025-01-14 14:23:28 +00:00
migrate [chore] update go dependencies (#4304) 2025-06-30 15:19:09 +02:00
schema [chore] bump dependencies (#4339) 2025-07-22 18:00:27 +02:00
.gitignore [chore] update bun + extras v1.1.16 -> v1.1.17 (#2534) 2024-01-15 14:08:07 +01:00
.prettierrc.yml upstep bun to v1.0.14 (#291) 2021-10-24 13:14:37 +02:00
bun.go [chore] update bun libraries to v1.2.5 (#3528) 2024-11-08 13:51:23 +00:00
CHANGELOG.md [chore] bump dependencies (#4339) 2025-07-22 18:00:27 +02:00
commitlint.config.js update bun library to latest commit (#206) 2021-09-11 13:53:44 +02:00
CONTRIBUTING.md bump uptrace/bun dependencies from 1.2.6 to 1.2.8 (#3645) 2025-01-14 14:23:28 +00:00
db.go [chore] bump dependencies (#4339) 2025-07-22 18:00:27 +02:00
hook.go [chore] bump db dependencies (#1366) 2023-01-22 12:26:47 +01:00
LICENSE Pg to bun (#148) 2021-08-25 15:34:33 +02:00
Makefile [chore] update go dependencies (#4304) 2025-06-30 15:19:09 +02:00
model.go [chore] update go dependencies (#4304) 2025-06-30 15:19:09 +02:00
model_map.go [chore] update go dependencies (#4304) 2025-06-30 15:19:09 +02:00
model_map_slice.go [chore] update go dependencies (#4304) 2025-06-30 15:19:09 +02:00
model_scan.go upstep bun to v1.0.14 (#291) 2021-10-24 13:14:37 +02:00
model_slice.go upstep bun to v1.0.9 (#252) 2021-09-29 15:09:45 +02:00
model_table_has_many.go [chore] update go dependencies (#4304) 2025-06-30 15:19:09 +02:00
model_table_m2m.go [chore] update go dependencies (#4304) 2025-06-30 15:19:09 +02:00
model_table_slice.go [chore] update go dependencies (#4304) 2025-06-30 15:19:09 +02:00
model_table_struct.go [chore] update go dependencies (#4304) 2025-06-30 15:19:09 +02:00
package.json [chore] bump dependencies (#4339) 2025-07-22 18:00:27 +02:00
query_base.go bumps our uptrace/bun dependencies to v1.2.10 (#3865) 2025-03-03 10:42:05 +00:00
query_column_add.go bumps our uptrace/bun dependencies to v1.2.10 (#3865) 2025-03-03 10:42:05 +00:00
query_column_drop.go bumps our uptrace/bun dependencies to v1.2.10 (#3865) 2025-03-03 10:42:05 +00:00
query_delete.go [chore] update go dependencies (#4304) 2025-06-30 15:19:09 +02:00
query_index_create.go bumps our uptrace/bun dependencies to v1.2.10 (#3865) 2025-03-03 10:42:05 +00:00
query_index_drop.go bumps our uptrace/bun dependencies to v1.2.10 (#3865) 2025-03-03 10:42:05 +00:00
query_insert.go [chore] update go dependencies (#4304) 2025-06-30 15:19:09 +02:00
query_merge.go [chore] update go dependencies (#4304) 2025-06-30 15:19:09 +02:00
query_raw.go [chore] update go dependencies (#4304) 2025-06-30 15:19:09 +02:00
query_select.go [chore] update go dependencies (#4304) 2025-06-30 15:19:09 +02:00
query_table_create.go [chore] bump dependencies (#4339) 2025-07-22 18:00:27 +02:00
query_table_drop.go [chore] update go dependencies (#4304) 2025-06-30 15:19:09 +02:00
query_table_truncate.go bumps our uptrace/bun dependencies to v1.2.10 (#3865) 2025-03-03 10:42:05 +00:00
query_update.go [chore] update go dependencies (#4304) 2025-06-30 15:19:09 +02:00
query_values.go bumps our uptrace/bun dependencies to v1.2.10 (#3865) 2025-03-03 10:42:05 +00:00
README.md bumps uptrace/bun dependencies to v1.2.6 (#3569) 2024-11-25 15:42:37 +00:00
relation_join.go bump uptrace/bun dependencies from 1.2.6 to 1.2.8 (#3645) 2025-01-14 14:23:28 +00:00
util.go bumps our uptrace/bun dependencies to v1.2.10 (#3865) 2025-03-03 10:42:05 +00:00
version.go [chore] bump dependencies (#4339) 2025-07-22 18:00:27 +02:00

SQL-first Golang ORM for PostgreSQL, MySQL, MSSQL, SQLite and Oracle

build workflow PkgGoDev Documentation Chat Gurubase

Bun is brought to you by uptrace/uptrace. Uptrace is an open-source APM tool that supports distributed tracing, metrics, and logs. You can use it to monitor applications and set up automatic alerts to receive notifications via email, Slack, Telegram, and others.

See OpenTelemetry example which demonstrates how you can use Uptrace to monitor Bun.

Features

Resources

Tutorials

Wrote a tutorial for Bun? Create a PR to add here and on Bun site.

Why another database client?

So you can elegantly write complex queries:

regionalSales := db.NewSelect().
	ColumnExpr("region").
	ColumnExpr("SUM(amount) AS total_sales").
	TableExpr("orders").
	GroupExpr("region")

topRegions := db.NewSelect().
	ColumnExpr("region").
	TableExpr("regional_sales").
	Where("total_sales > (SELECT SUM(total_sales) / 10 FROM regional_sales)")

var items []map[string]interface{}
err := db.NewSelect().
	With("regional_sales", regionalSales).
	With("top_regions", topRegions).
	ColumnExpr("region").
	ColumnExpr("product").
	ColumnExpr("SUM(quantity) AS product_units").
	ColumnExpr("SUM(amount) AS product_sales").
	TableExpr("orders").
	Where("region IN (SELECT region FROM top_regions)").
	GroupExpr("region").
	GroupExpr("product").
	Scan(ctx, &items)
WITH regional_sales AS (
    SELECT region, SUM(amount) AS total_sales
    FROM orders
    GROUP BY region
), top_regions AS (
    SELECT region
    FROM regional_sales
    WHERE total_sales > (SELECT SUM(total_sales)/10 FROM regional_sales)
)
SELECT region,
       product,
       SUM(quantity) AS product_units,
       SUM(amount) AS product_sales
FROM orders
WHERE region IN (SELECT region FROM top_regions)
GROUP BY region, product

And scan results into scalars, structs, maps, slices of structs/maps/scalars:

users := make([]User, 0)
if err := db.NewSelect().Model(&users).OrderExpr("id ASC").Scan(ctx); err != nil {
	panic(err)
}

user1 := new(User)
if err := db.NewSelect().Model(user1).Where("id = ?", 1).Scan(ctx); err != nil {
	panic(err)
}

See Getting started guide and check examples.

See also

Contributing

See CONTRIBUTING.md for some hints.

And thanks to all the people who already contributed!