dbstat

package
v0.1.0-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package dbstat divides a SQLite file's pages among the tables and indexes that own them, as SQLite's dbstat table does, for measurements: SQLite as the driver builds it leaves dbstat out.

It reads the file and not a connection, so a page the write-ahead log still holds is not counted: close the file, or checkpoint it, first.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Object

type Object struct {
	Name  string
	Pages int64 // its b-tree's pages with their overflow pages
	Bytes int64 // what dbstat's sum(pgsize) gives
}

Object is one b-tree of the file, sqlite_schema's included.

func Read

func Read(ctx context.Context, path string) (_ []Object, err error)

Read divides the file at path, each object in the order sqlite_schema lists it. It fails unless every page of the file is an object's, the freelist's, a pointer map's or the one that holds SQLite's lock bytes, each counted once.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL