2024-09-17 01:01:42 +00:00
|
|
|
package postgresql
|
|
|
|
|
|
|
|
import (
|
2025-01-14 04:43:49 +00:00
|
|
|
"sync"
|
|
|
|
|
2024-09-17 01:01:42 +00:00
|
|
|
"github.com/jmoiron/sqlx"
|
|
|
|
)
|
|
|
|
|
|
|
|
type PostgresBackend struct {
|
2025-01-14 04:43:49 +00:00
|
|
|
sync.Mutex
|
2024-09-17 01:01:42 +00:00
|
|
|
*sqlx.DB
|
|
|
|
DatabaseURL string
|
|
|
|
QueryLimit int
|
|
|
|
QueryIDsLimit int
|
|
|
|
QueryAuthorsLimit int
|
|
|
|
QueryKindsLimit int
|
|
|
|
QueryTagsLimit int
|
|
|
|
KeepRecentEvents bool
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *PostgresBackend) Close() {
|
|
|
|
b.DB.Close()
|
|
|
|
}
|