Skip to content
3 changes: 2 additions & 1 deletion cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ func setupLogger(cfg *cfgpkg.Config) {
func newRepository(cfg cfgpkg.StorageConfig) (output.MessageRepository, io.Closer, error) {
switch strings.ToUpper(cfg.Type) {
case "SQLITE":
repo, err := sqliteadapter.New(cfg.Path)
repo, err := sqliteadapter.New(cfg.Path, cfg.TableName)
if err != nil {
return nil, nil, fmt.Errorf("sqlite repository: %w", err)
}
Expand All @@ -371,6 +371,7 @@ func newRepository(cfg cfgpkg.StorageConfig) (output.MessageRepository, io.Close
MaxOpenConns: cfg.MaxOpenConns,
MaxIdleConns: cfg.MaxIdleConns,
ConnMaxLifetime: lifetime,
TableName: cfg.TableName,
})
if err != nil {
return nil, nil, fmt.Errorf("mariadb repository: %w", err)
Expand Down
1 change: 1 addition & 0 deletions docs/config.docker-mariadb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ storage:
maxOpenConns: 10
maxIdleConns: 5
connMaxLifetime: "5m"
tableName: messages # 메시지 테이블 이름 (기본값: messages)

queue:
type: FILE
Expand Down
1 change: 1 addition & 0 deletions docs/config.docker-sqlite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ outputs:
storage:
type: SQLITE
path: "/app/data/relaybox.db"
tableName: messages # 메시지 테이블 이름 (기본값: messages)

queue:
type: FILE
Expand Down
3 changes: 3 additions & 0 deletions docs/config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ server:

log:
level: INFO # DEBUG, INFO, WARN, ERROR
# 주의: DEBUG 레벨은 요청 헤더(Authorization 포함) 및 전체 바디를 로그에 기록합니다.
# 운영 환경에서는 INFO 이상을 권장합니다.
format: JSON # JSON, TEXT

inputs:
Expand Down Expand Up @@ -71,6 +73,7 @@ outputs:
storage:
type: SQLITE
path: "./data/relaybox.db"
tableName: messages # 메시지 테이블 이름 (기본값: messages)

queue:
type: FILE
Expand Down
Loading
Loading