定义一个配置记录是不是timescaledb
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
// 使用GORM作为ORM库
|
||||
type PostgresStorage struct {
|
||||
db *gorm.DB
|
||||
isTimescaleDB bool
|
||||
connectionString string
|
||||
maxOpenConns int
|
||||
maxIdleConns int
|
||||
@@ -25,9 +26,10 @@ type PostgresStorage struct {
|
||||
|
||||
// NewPostgresStorage 创建并返回一个新的PostgreSQL存储实例
|
||||
// 它接收一个 logger 实例,而不是自己创建
|
||||
func NewPostgresStorage(connectionString string, maxOpenConns, maxIdleConns, connMaxLifetime int, logger *logs.Logger) *PostgresStorage {
|
||||
func NewPostgresStorage(connectionString string, isTimescaleDB bool, maxOpenConns, maxIdleConns, connMaxLifetime int, logger *logs.Logger) *PostgresStorage {
|
||||
return &PostgresStorage{
|
||||
connectionString: connectionString,
|
||||
isTimescaleDB: isTimescaleDB,
|
||||
maxOpenConns: maxOpenConns,
|
||||
maxIdleConns: maxIdleConns,
|
||||
connMaxLifetime: connMaxLifetime,
|
||||
|
||||
Reference in New Issue
Block a user