Versions in this module Expand all Collapse all v0 v0.1.0 Jul 3, 2025 Changes in this version + func AddToBuffer(ctx context.Context, model interface{}, bufferSize int) error + func BatchInsertData(ctx context.Context, records interface{}, batchSize int, ...) error + func Connect(cfg DBConfig) (*gorm.DB, error) + func CreateTable(ctx context.Context, model interface{}, tableName ...string) error + func DeleteData(ctx context.Context, model interface{}, conditions map[string]interface{}) error + func ExecuteCustomQuery(ctx context.Context, query string, args ...interface{}) error + func ExecuteQueryWithContext(ctx context.Context, query string, args []interface{}) error + func FetchData(ctx context.Context, model interface{}, conditions map[string]interface{}) error + func FlushBufferToDB(ctx context.Context) error + func GetDB() *gorm.DB + func InsertData(ctx context.Context, record interface{}) error + func IsTableExists(ctx context.Context, model interface{}, tableName ...string) bool + func RunMigrations(cfg DBConfig, migrationsDir string) error + func StartBufferFlusher(ctx context.Context, interval time.Duration) + func UpdateData(ctx context.Context, model interface{}, updates map[string]interface{}, ...) error + type BatchInsertConfig struct + ConflictColumns []string + DoNothing bool + Updates map[string]interface{} + type ConflictOption func(*BatchInsertConfig) + func WithOnConflictDoNothing(columns []string) ConflictOption + func WithOnConflictDoUpdate(columns []string, updates map[string]interface{}) ConflictOption + type DBConfig struct + DBName string + Host string + MaxConnIdleTime time.Duration + MaxConnLifetime time.Duration + MaxConns int + MinConns int + Password string + Port int + User string + type Postgres interface + Connect func(cfg DBConfig) (*gorm.DB, error) + GetDB func() *gorm.DB + RunMigrations func(cfg DBConfig, migrationsDir string) error