mirror of
https://github.com/jeremyd/ergo.git
synced 2026-08-02 20:23:06 -07:00
5fd8ed8ed6
Postgres support is behind a build tag; use `make build_full` or `make install_full` to compile it in.
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
//go:build !postgres
|
|
|
|
// Copyright (c) 2020 Shivaram Lingamneni
|
|
// released under the MIT license
|
|
|
|
// Package postgres provides a stub implementation when PostgreSQL support is not enabled.
|
|
// To enable PostgreSQL support, build with: make build_full
|
|
// This stub prevents the binary from including the large pgx PostgreSQL driver dependencies.
|
|
package postgres
|
|
|
|
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
|
|
}
|