Discover Packages
github.com/Ithildur/EiluneKit
postgres
gorm
package
Version:
v0.1.5
Opens a new window with list of versions in this module.
Published: Apr 21, 2026
License: MIT
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0 modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package gorm provides GORM helpers for Postgres.
Package gorm 提供 Postgres 的 GORM 辅助函数。
BuildDSN returns the Postgres DSN for cfg.
BuildDSN 返回 cfg 的 Postgres DSN。
Connect opens and verifies a Postgres-backed GORM DB.
Call Connect(ctx, Config{...}).
Connect 打开并验证基于 Postgres 的 GORM DB。
调用 Connect(ctx, Config{...})。
Example / 示例:
db, _ := gorm.Connect(ctx, gorm.Config{Host: "localhost", Port: 5432, User: "app", Name: "db"})
NewLogger returns a GORM logger backed by slog.
Call NewLogger(LogOptions{Logger: base, Level: slog.LevelInfo}).
NewLogger 返回基于 slog 的 GORM logger。
调用 NewLogger(LogOptions{Logger: base, Level: slog.LevelInfo})。
Ping checks connectivity through db.DB().
Ping 通过 db.DB() 检查连通性。
Config configures Connect.
Config 配置 Connect。
LogOptions configures NewLogger.
LogOptions 配置 NewLogger。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.