英文: How to check for custom Postgres exceptions raised via RAISE EXCEPTION in Golang? 问题 我正在使用Postgr...
"error: pq: role "root" does not exist" when running pq with Postgres for Docker
英文: "error: pq: role "root" does not exist" when running pq with Postgres for Do...
Gorm V1与V2的区别
英文: Gorm V1 vs V2 differences 问题 有人能解释一下使用方言的 Gorm v1 和 Gorm v2 之间的区别吗? 我一直在重用之前项目中的代码,该代码使用 Gorm v1...
How to handle postgres DB connection timeout/drop in gorm
英文: How to handle postgres DB connection timeout/drop in gorm 问题 我的DB连接及其getter如下所示: func connectDB(...
使用pgx和bun(Golang)与内存数据库
英文: Using an in-memory db with pgx and bun (Golang) 问题 我刚刚开始使用Golang的pgx和bun,现在我需要开始测试我的存储库实现。我不太清楚是...
在upsert操作(db.Clauses clause.OnConflict)中获取已存在和已插入的ID。
英文: Get existing and inserted IDs in upsert operation (db.Clauses clause.OnConflict) 问题 我已经翻译了你提供的内容...
GORM外键似乎没有添加正确的字段。
英文: GORM foreign key doesn't seem to add proper fields 问题 我有以下模型: type Drink struct { gorm.Model...
sql.Scan在应该返回ErrNoRows错误时没有返回
英文: sql.Scan not returning ErrNoRows error when it should 问题 我有一个由sqlc生成的GetAccount函数。 当我调用GetAccoun...
在一个查询中使用多个计数。
英文: Use mulitple counts in one query 问题 我有以下的结构体和查询代码: type Result struct { StartedLast15Minutes int...
Golang的database/sql在使用env文件时无法连接。
英文: Golang database/sql does not connect when using env file 问题 这是因为在使用os.Getenv函数获取环境变量时,没有正确设置DATA...
148