Documentation
¶
Index ¶
- Constants
- Variables
- func ContextWithTx(ctx context.Context, tx *sql.Tx) context.Context
- func ExecuteTransaction[T any](f func(tx *sql.Tx) (T, error)) (T, error)
- func GetDB() *sql.DB
- func GetTelemetryIngestCounters() (dropped map[string]uint64, droppedTotal uint64, insertFailures uint64)
- func GetTx(ctx context.Context) *sql.Tx
- func Init() error
- func IsDuckDBTelemetry() bool
- func IsSQLite() bool
- func IsUniqueViolation(err error) bool
- func QueryerFromContext(ctx context.Context) interface{ ... }
- func RecordTelemetryInsertFailure()
- func RecordTelemetryRowDropped(table string)
- func TelemetryBackendName() string
- type TelemetryEngineStats
Constants ¶
View Source
const TransactionContextKey = "dbTx"
Variables ¶
View Source
var DB *sql.DB // PostgreSQL-replacement: relational/config data (transactional)
View Source
var Driver lit.Driver = lit.PostgreSQL
View Source
var TelemetryDB *sql.DB // ClickHouse-replacement: append-only telemetry data (non-transactional)
Functions ¶
func GetTelemetryIngestCounters ¶ added in v1.9.0
func Init ¶
func Init() error
Init opens the main (transactional) database selected by the transactional_* build axis, then the telemetry database selected by the telemetry_* build axis.
func IsDuckDBTelemetry ¶ added in v1.9.0
func IsDuckDBTelemetry() bool
func IsUniqueViolation ¶ added in v1.9.4
func QueryerFromContext ¶
func RecordTelemetryInsertFailure ¶ added in v1.9.0
func RecordTelemetryInsertFailure()
func RecordTelemetryRowDropped ¶ added in v1.9.0
func RecordTelemetryRowDropped(table string)
func TelemetryBackendName ¶ added in v1.9.0
func TelemetryBackendName() string
Types ¶
type TelemetryEngineStats ¶ added in v1.9.0
type TelemetryEngineStats struct {
DBSizeBytes int64 `json:"dbSizeBytes"`
WALSizeBytes int64 `json:"walSizeBytes"`
MemoryUsedBytes int64 `json:"memoryUsedBytes"`
ReadPoolInUse int `json:"readPoolInUse"`
ReadPoolWaitCount int64 `json:"readPoolWaitCount"`
ReadPoolWaitMs int64 `json:"readPoolWaitMs"`
}
func GetTelemetryEngineStats ¶ added in v1.9.0
func GetTelemetryEngineStats(ctx context.Context) (TelemetryEngineStats, bool)
Click to show internal directories.
Click to hide internal directories.