database

package
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package database provides the database configuration for the Scroll paymaster service.

Package database provides database utilities for the Scroll paymaster service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseDB

func CloseDB(db *gorm.DB) error

CloseDB close the db handler. notice the db handler only can close when then program exit.

func InitDB

func InitDB(config Config) (*gorm.DB, error)

InitDB init the db handler

func Ping

func Ping(db *gorm.DB) (*sql.DB, error)

Ping check db status

Types

type Config

type Config struct {
	// data source name
	DSN        string `json:"dsn"`
	DriverName string `json:"driver_name"`

	MaxOpenNum int `json:"maxOpenNum"`
	MaxIdleNum int `json:"maxIdleNum"`
}

Config db config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL