Documentation
¶
Index ¶
- func Begin() (*sql.Tx, error)
- func CheckSchema() error
- func Close() error
- func ConnectionTarget(databaseURL string) (host, database string)
- func Exec(query string, args ...any) (sql.Result, error)
- func HashString(value string) string
- func Init(url string) error
- func Ping() error
- func Query(query string, args ...any) (*sql.Rows, error)
- func QueryJSON(dst any, query string, args ...any) error
- func QueryRow(query string, args ...any) *sql.Row
- func ResetForTest()
- func ResetSchema() error
- func Select(dest any, query string, args ...any) error
- func SetHashPepper(pepper []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSchema ¶
func CheckSchema() error
CheckSchema reports whether the schema has been applied (Admin TUI init, etc.).
func ConnectionTarget ¶
ConnectionTarget returns host and database name from a PostgreSQL URL (no credentials).
func HashString ¶
HashString returns a peppered HMAC-SHA256 hex digest for DB lookups (name_hash / phone_hash). Without the pepper, E.164 / username dictionaries cannot be matched offline against a DB dump alone.
func ResetForTest ¶
func ResetForTest()
ResetForTest closes the database and allows Init to run again. Test use only.
func ResetSchema ¶
func ResetSchema() error
ResetSchema drops all public tables and applies schema.sql on the database opened by Init.
func SetHashPepper ¶
func SetHashPepper(pepper []byte)
SetHashPepper configures the HMAC key for HashString. Required before hashing name/phone lookup values.
Types ¶
This section is empty.