Files
ergo/irc/postgresql/stub.go
T
Shivaram Lingamneni e7558f292c build changes (#2356)
* default build includes everything
* allow compiling out PRECIS and Skeleton (still included by default)
* consistently use `postgresql` in identifiers
2026-03-12 21:48:37 -04:00

32 lines
841 B
Go

//go:build !postgresql
// Copyright (c) 2020 Shivaram Lingamneni
// released under the MIT license
package postgresql
import (
"errors"
"github.com/ergochat/ergo/irc/history"
"github.com/ergochat/ergo/irc/logger"
)
// Enabled is false when PostgreSQL support is not compiled in
const Enabled = false
// PostgreSQL is a stub implementation when the postgres build tag is not present
type PostgreSQL struct {
history.Database
}
// NewPostgreSQLDatabase returns an error when PostgreSQL support is not compiled in
func NewPostgreSQLDatabase(logger *logger.Manager, config Config) (*PostgreSQL, error) {
return nil, errors.New("PostgreSQL support not enabled in this build. Rebuild with `make build_full` to enable")
}
// SetConfig is a no-op for the stub implementation
func (pg *PostgreSQL) SetConfig(config Config) {
// no-op
}