bun icon indicating copy to clipboard operation
bun copied to clipboard

SQL-first Golang ORM

Results 235 bun issues
Sort by recently updated
recently updated
newest added

When embedding structs, I have been following this guide: [https://bun.uptrace.dev/guide/models.html#embedding-structs](https://bun.uptrace.dev/guide/models.html#embedding-structs) This works great and enables to have concatenated column names given the struct as follows (per official example): ```go type...

enhancement

Hi! Can you support encrypted SQLite (SQLcipher)? I hope we can get a pure Go package (without CGO) like https://github.com/jackfr0st13/gorm-sqlite-cipher Thanks :pray:

enhancement
help wanted

Why result so weird ? `var m map[string]interface{} err := db.Raw(r.Query).Scan(context.Background(), &m)` `map[agent:[48 46 50 53 50 48] agent_commission:[48 46 48 48 48 48] agent_id:5099295 agent_total:[48 46 50 53 50...

question

1. First question: Comparing to [go-pg migration tool](https://github.com/go-pg/migrations) we've lost ability to use [`set_version`](https://github.com/go-pg/migrations/blob/v8/collection.go#L510) for some edge cases (semi-automatic-hardcoded migrations). I guess it happens due the nature of new way...

enhancement
good first issue

Is there any way to add additional condition when using Relation ? ```go q := repo.db.NewSelect().Model(&product) q.Relation("Stock", func(q *bun.SelectQuery) *bun.SelectQuery { return q.Where("branch_id = ?", filter.BranchId) }) ``` This above...

enhancement

Calling COPY with QueryContext seems to hold the connection forever without ever releasing it back into the pool. Minimal example: ``` package main import ( "context" "database/sql" "fmt" "log" "time"...

First, we should provide some unified way to inspect current database schema via using `INFORMATION_SCHEMA.TABLES` or something similar. Then we can sync the database by comparing the actual database schema...

enhancement
help wanted

After working on #633 I realized that it may be possible to trigger the builtin retry behavior of `database/sql` when receiving `FATAL` errors from PostgreSQL (for instance, the `57P01 terminating...

Version: 1.1.7 I want to set a jsonb default, like: ```jsavscript { title: 'title', token: 'token' } ``` when I define a model: ```golang Field map[string]interface{} `bun:"field,nullzero,notnull,type:jsonb,default:'{ \"title\": \"title\", \"token\":...

bug

I don't know why but if I use these Relation()` calls I get the below error: ```go output := make([]Player, 0, limit) query := db.NewSelect().Model(&output) query.Relation("Game").Relation("Game.Team").Relation("Game.Team.Friend").Relation("Game.Team.Marketing").Relation("Game.Team.Marketing.Commerce") ``` ``` ERR error="sql:...

question