3
0
mirror of https://github.com/ergochat/ergo.git synced 2026-03-14 03:08:11 +01:00
ergo/irc/sqlite/stub.go
Shivaram Lingamneni ca4c3c09df
goreleaser updates for v2.18 (#2357)
* Full build is default
* sqlite is only supported on Linux, MacOS, and FreeBSD;
  override the sqlite build tag based on OS where unsupported
2026-03-12 22:37:56 -04:00

35 lines
1.1 KiB
Go

//go:build !sqlite || !(linux || darwin || freebsd || windows)
// Copyright (c) 2020 Shivaram Lingamneni
// released under the MIT license
// Package sqlite provides a stub implementation when SQLite support is not enabled.
// To enable SQLite support, build with: make build_full
// This stub prevents the binary from including the large modernc.org/sqlite driver dependencies.
package sqlite
import (
"errors"
"github.com/ergochat/ergo/irc/history"
"github.com/ergochat/ergo/irc/logger"
)
// Enabled is false when SQLite support is not compiled in
const Enabled = false
// SQLite is a stub implementation when the sqlite build tag is not present
type SQLite struct {
history.Database
}
// NewSQLiteDatabase returns an error when SQLite support is not compiled in
func NewSQLiteDatabase(logger *logger.Manager, config Config) (*SQLite, error) {
return nil, errors.New("SQLite support not enabled in this build. Rebuild with `make build_full` to enable")
}
// SetConfig is a no-op for the stub implementation
func (s *SQLite) SetConfig(config Config) {
// no-op
}