package sqlite3
import "github.com/go-sqlite/sqlite3"
Package sqlite3 decodes the SQLite-3 file format.
Index ¶
- Constants
- type Column
- type DbFile
- func Open(fname string) (*DbFile, error)
- func OpenFrom(f io.ReadSeeker) (*DbFile, error)
- func (db *DbFile) Close() error
- func (db *DbFile) Dumpdb() error
- func (db *DbFile) Encoding() int
- func (db *DbFile) NumPage() int
- func (db *DbFile) PageSize() int
- func (db *DbFile) Tables() []Table
- func (db *DbFile) Version() int
- func (db *DbFile) VisitTableRecords(tableName string, f func(*int64, Record) error) error
- type PageKind
- type Record
- type RecordHeader
- type SerialType
- func (st SerialType) IsBlob() bool
- func (st SerialType) IsText() bool
- func (st SerialType) NBytes() int
- func (st SerialType) String() string
- type Table
Constants ¶
const ( BTreeInteriorIndexKind = zeroDataKind BTreeInteriorTableKind = leafDataKind | intKeyKind BTreeLeafIndexKind = zeroDataKind | leafKind BTreeLeafTableKind = leafDataKind | intKeyKind | leafKind )
Types ¶
type Column ¶
type Column struct {
// contains filtered or unexported fields
}
Column describes a column in a SQLite table
func (*Column) Name ¶
Name returns the name of the column
func (*Column) Type ¶
Type returns the SQLite type of the column
type DbFile ¶
type DbFile struct {
// contains filtered or unexported fields
}
func Open ¶
func OpenFrom ¶
func OpenFrom(f io.ReadSeeker) (*DbFile, error)
func (*DbFile) Close ¶
func (*DbFile) Dumpdb ¶
func (*DbFile) Encoding ¶
Encoding returns the text encoding for this database
func (*DbFile) NumPage ¶
NumPage returns the number of pages for this database
func (*DbFile) PageSize ¶
PageSize returns the database page size in bytes
func (*DbFile) Tables ¶
func (*DbFile) Version ¶
Version returns the sqlite version number used to create this database
func (*DbFile) VisitTableRecords ¶
VisitTableRecords performs an inorder traversal of all cells in the btree for the table with the given name, passing the (optional, hence nullable) RowID, and record-decoded payload of each cell to the visitor function `f`.
type PageKind ¶
type PageKind byte
PageKind describes what kind of page is.
func (PageKind) String ¶
type Record ¶
type Record struct { Header RecordHeader Body []byte Values []interface{} }
type RecordHeader ¶
type RecordHeader struct { Len int Types []SerialType }
type SerialType ¶
type SerialType int
SerialType represents SQLite types on disk
const ( StNull SerialType = iota StInt8 StInt16 StInt24 StInt32 StInt48 StInt64 StFloat StC0 StC1 StBlob SerialType = 12 StText = 13 )
func (SerialType) IsBlob ¶
func (st SerialType) IsBlob() bool
func (SerialType) IsText ¶
func (st SerialType) IsText() bool
func (SerialType) NBytes ¶
func (st SerialType) NBytes() int
NBytes returns the number of bytes on disk for this SerialType NBytes returns -1 if the SerialType is invalid.
func (SerialType) String ¶
func (st SerialType) String() string
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table is a SQLite table
func (*Table) Columns ¶
Columns returns the columns of the table
func (*Table) Name ¶
Name returns the name of the table
func (*Table) NumRow ¶
NumRow returns the number of rows in the table
Source Files ¶
btree.go cell.go file.go page.go pager.go record.go sqlite.go stypes.go table.go utils.go
Directories ¶
Path | Synopsis |
---|---|
cmd | |
cmd/sqlite-dump | Command sqlite-dump is a simple command that dumps the high-level content of a SQLITE3 file on screen. |
- Version
- v0.0.0-20180313105335-53dd8e640ee7 (latest)
- Published
- Mar 13, 2018
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 1 month ago –
Tools for package owners.