Versions in this module Expand all Collapse all v1 v1.12.8 Feb 14, 2025 v1.12.7 Feb 14, 2025 v1.12.6 Feb 14, 2025 Changes in this version + const MaxCharacterLength + const MaxColumnNameLength + const MaxFloatLength + const MaxIntegerValue + const MaxNumericLength + const MinIntegerValue + var ErrBOF = errors.New("BOF") + var ErrEOF = errors.New("EOF") + var ErrIncomplete = errors.New("INCOMPLETE") + var ErrInvalidEncoding = errors.New("INVALID_ENCODING") + var ErrInvalidPosition = errors.New("INVALID_POSITION") + var ErrNoDBF = errors.New("DBF_FILE_NOT_FOUND") + var ErrNoFPT = errors.New("FPT_FILE_NOT_FOUND") + var ErrUnknownDataType = errors.New("UNKNOWN_DATA_TYPE") + func Debug(enabled bool, out io.Writer) + func RegisterCustomEncoding(codePageMark byte, encoding encoding.Encoding) + func ValidateFileVersion(version byte, untested bool) error + type Column struct + DataType byte + Decimals uint8 + FieldName [11]byte + Flag byte + Length uint8 + Next uint32 + Position uint32 + Reserved [7]byte + Step uint16 + func NewColumn(name string, dataType DataType, length uint8, decimals uint8, nullable bool) (*Column, error) + func (c *Column) Name() string + func (c *Column) Reflect() (reflect.Type, error) + func (c *Column) Type() string + type ColumnFlag byte + const AutoincrementFlag + const BinaryFlag + const HiddenFlag + const NullableFlag + type Config struct + CollapseSpaces bool + Converter EncodingConverter + DisableConvertFilenameUnderscores bool + Exclusive bool + Filename string + IO IO + InterpretCodePage bool + ReadOnly bool + TrimSpaces bool + Untested bool + ValidateCodePage bool + WriteLock bool + type DataType byte + const Blob + const Character + const Currency + const Date + const DateTime + const Double + const Float + const General + const Integer + const Logical + const Memo + const Numeric + const Picture + const Varbinary + const Varchar + func (t DataType) Reflect() (reflect.Type, error) + func (t DataType) String() string + type Database struct + func OpenDatabase(config *Config) (*Database, error) + func (db *Database) Close() error + func (db *Database) Names() []string + func (db *Database) Schema() map[string][]*Column + func (db *Database) Tables() map[string]*File + type DefaultConverter struct + func ConverterFromCodePage(codePageMark byte) DefaultConverter + func NewDefaultConverter(encoding encoding.Encoding) DefaultConverter + func (c DefaultConverter) CodePage() byte + func (c DefaultConverter) Decode(in []byte) ([]byte, error) + func (c DefaultConverter) Encode(in []byte) ([]byte, error) + type EncodingConverter interface + CodePage func() byte + Decode func(in []byte) ([]byte, error) + Encode func(in []byte) ([]byte, error) + type Error struct + func NewError(err string) Error + func NewErrorf(format string, a ...interface{}) Error + func WrapError(err error) Error + func (e Error) Details(err error) Error + func (e Error) Error() string + type Field struct + func (field *Field) SetValue(value interface{}) error + func (field Field) Column() *Column + func (field Field) GetValue() interface{} + func (field Field) Name() string + func (field Field) Type() DataType + type File struct + func NewTable(version FileVersion, config *Config, columns []*Column, memoBlockSize uint16, ...) (*File, error) + func OpenTable(config *Config) (*File, error) + func (file *File) BOF() bool + func (file *File) BytesToRow(data []byte) (*Row, error) + func (file *File) Close() error + func (file *File) Column(pos int) *Column + func (file *File) ColumnNames() []string + func (file *File) ColumnPos(column *Column) int + func (file *File) ColumnPosByName(colname string) int + func (file *File) Columns() []*Column + func (file *File) ColumnsCount() uint16 + func (file *File) Create() error + func (file *File) Deleted() (bool, error) + func (file *File) EOF() bool + func (file *File) GetColumnModification(position int) *Modification + func (file *File) GetHandle() (interface{}, interface{}) + func (file *File) GetIO() IO + func (file *File) GoTo(row uint32) error + func (file *File) Header() *Header + func (file *File) Init() error + func (file *File) Interpret(raw []byte, column *Column) (interface{}, error) + func (file *File) NewField(pos int, value interface{}) (*Field, error) + func (file *File) NewFieldByName(name string, value interface{}) (*Field, error) + func (file *File) NewRow() *Row + func (file *File) Next() (*Row, error) + func (file *File) Pointer() uint32 + func (file *File) ReadColumns() ([]*Column, *Column, error) + func (file *File) ReadHeader() error + func (file *File) ReadMemo(address []byte) ([]byte, bool, error) + func (file *File) ReadMemoHeader() error + func (file *File) ReadNullFlag(position uint64, column *Column) (bool, bool, error) + func (file *File) ReadRow(position uint32) ([]byte, error) + func (file *File) Represent(field *Field, padding bool) ([]byte, error) + func (file *File) Row() (*Row, error) + func (file *File) RowFromJSON(j []byte) (*Row, error) + func (file *File) RowFromMap(m map[string]interface{}) (*Row, error) + func (file *File) RowFromStruct(v interface{}) (*Row, error) + func (file *File) Rows(skipInvalid bool, skipDeleted bool) ([]*Row, error) + func (file *File) RowsCount() uint32 + func (file *File) Search(field *Field, exactMatch bool) ([]*Row, error) + func (file *File) SetColumnModification(position int, mod *Modification) + func (file *File) SetColumnModificationByName(name string, mod *Modification) error + func (file *File) Skip(offset int64) + func (file *File) TableName() string + func (file *File) WriteColumns() error + func (file *File) WriteHeader() error + func (file *File) WriteMemo(data []byte, text bool, length int) ([]byte, error) + func (file *File) WriteMemoHeader(size int) error + func (file *File) WriteRow(row *Row) error + type FileExtension string + const DBC + const DBF + const DCT + const FPT + const LBX + const MNX + const PJX + const RPX + const SCX + const VCX + type FileVersion byte + const DBaseMemo + const DBaseSQLMemo + const DBaseSQLTable + const FoxBase + const FoxBase2 + const FoxBasePlus + const FoxBasePlusMemo + const FoxPro + const FoxPro2Memo + const FoxProAutoincrement + const FoxProVar + type GenericIO struct + Handle io.ReadWriteSeeker + RelatedHandle io.ReadWriteSeeker + func (g GenericIO) Close(file *File) error + func (g GenericIO) Create(file *File) error + func (g GenericIO) Deleted(file *File) (bool, error) + func (g GenericIO) GoTo(file *File, row uint32) error + func (g GenericIO) OpenTable(config *Config) (*File, error) + func (g GenericIO) ReadColumns(file *File) ([]*Column, *Column, error) + func (g GenericIO) ReadHeader(file *File) error + func (g GenericIO) ReadMemo(file *File, address []byte) ([]byte, bool, error) + func (g GenericIO) ReadMemoHeader(file *File) error + func (g GenericIO) ReadNullFlag(file *File, position uint64, column *Column) (bool, bool, error) + func (g GenericIO) ReadRow(file *File, position uint32) ([]byte, error) + func (g GenericIO) Search(file *File, field *Field, exactMatch bool) ([]*Row, error) + func (g GenericIO) Skip(file *File, offset int64) + func (g GenericIO) WriteColumns(file *File) error + func (g GenericIO) WriteHeader(file *File) error + func (g GenericIO) WriteMemo(file *File, raw []byte, text bool, length int) ([]byte, error) + func (g GenericIO) WriteMemoHeader(file *File, size int) error + func (g GenericIO) WriteRow(file *File, row *Row) error + type Header struct + CodePage byte + Day uint8 + FileType byte + FirstRow uint16 + Month uint8 + Reserved [16]byte + RowLength uint16 + RowsCount uint32 + TableFlags byte + Year uint8 + func (h *Header) ColumnsCount() uint16 + func (h *Header) FileSize() int64 + func (h *Header) Modified(base int) time.Time + func (h *Header) RecordsCount() uint32 + type IO interface + Close func(file *File) error + Create func(file *File) error + Deleted func(file *File) (bool, error) + GoTo func(file *File, row uint32) error + OpenTable func(config *Config) (*File, error) + ReadColumns func(file *File) ([]*Column, *Column, error) + ReadHeader func(file *File) error + ReadMemo func(file *File, address []byte) ([]byte, bool, error) + ReadMemoHeader func(file *File) error + ReadNullFlag func(file *File, position uint64, column *Column) (bool, bool, error) + ReadRow func(file *File, position uint32) ([]byte, error) + Search func(file *File, field *Field, exactMatch bool) ([]*Row, error) + Skip func(file *File, offset int64) + WriteColumns func(file *File) error + WriteHeader func(file *File) error + WriteMemo func(file *File, raw []byte, text bool, length int) ([]byte, error) + WriteMemoHeader func(file *File, size int) error + WriteRow func(file *File, row *Row) error + type Marker byte + const Active + const Blank + const ColumnEnd + const Deleted + const EOFMarker + const Null + type MemoHeader struct + BlockSize uint16 + NextFree uint32 + Unused [2]byte + type Modification struct + Convert func(interface{}) (interface{}, error) + ExternalKey string + TrimSpaces bool + type Row struct + ByteOffset int64 + Deleted bool + Position uint32 + func (row *Row) Add() error + func (row *Row) BoolValueByName(name string) (bool, error) + func (row *Row) BytesValueByName(name string) ([]byte, error) + func (row *Row) Field(pos int) *Field + func (row *Row) FieldByName(name string) *Field + func (row *Row) Fields() []*Field + func (row *Row) FloatValueByName(name string) (float64, error) + func (row *Row) Increment() error + func (row *Row) IntValueByName(name string) (int64, error) + func (row *Row) MustBoolValueByName(name string) bool + func (row *Row) MustBytesValueByName(name string) []byte + func (row *Row) MustFloatValueByName(name string) float64 + func (row *Row) MustIntValueByName(name string) int64 + func (row *Row) MustStringValueByName(name string) string + func (row *Row) MustTimeValueByName(name string) time.Time + func (row *Row) MustValueByName(name string) interface{} + func (row *Row) StringValueByName(name string) (string, error) + func (row *Row) TimeValueByName(name string) (time.Time, error) + func (row *Row) ToBytes() ([]byte, error) + func (row *Row) ToJSON() ([]byte, error) + func (row *Row) ToMap() (map[string]interface{}, error) + func (row *Row) ToStruct(v interface{}) error + func (row *Row) Value(pos int) interface{} + func (row *Row) ValueByName(name string) (interface{}, error) + func (row *Row) Values() []interface{} + func (row *Row) Write() error + type Table struct + type TableFlag byte + const DatabaseFlag + const MemoFlag + const StructuralFlag + func (t TableFlag) Defined(flag byte) bool + type UnixIO struct — darwin/amd64, js/wasm, linux/amd64 + var DefaultIO UnixIO + func (u UnixIO) Close(file *File) error + func (u UnixIO) Create(file *File) error + func (u UnixIO) Deleted(file *File) (bool, error) + func (u UnixIO) GoTo(file *File, row uint32) error + func (u UnixIO) OpenTable(config *Config) (*File, error) + func (u UnixIO) ReadColumns(file *File) ([]*Column, *Column, error) + func (u UnixIO) ReadHeader(file *File) error + func (u UnixIO) ReadMemo(file *File, blockdata []byte) ([]byte, bool, error) + func (u UnixIO) ReadMemoHeader(file *File) error + func (u UnixIO) ReadNullFlag(file *File, rowPosition uint64, column *Column) (bool, bool, error) + func (u UnixIO) ReadRow(file *File, position uint32) ([]byte, error) + func (u UnixIO) Search(file *File, field *Field, exactMatch bool) ([]*Row, error) + func (u UnixIO) Skip(file *File, offset int64) + func (u UnixIO) WriteColumns(file *File) error + func (u UnixIO) WriteHeader(file *File) error + func (u UnixIO) WriteMemo(file *File, raw []byte, text bool, length int) ([]byte, error) + func (u UnixIO) WriteMemoHeader(file *File, size int) error + func (u UnixIO) WriteRow(file *File, row *Row) error + type WindowsIO struct — windows/amd64 + var DefaultIO WindowsIO + func (w WindowsIO) Close(file *File) error + func (w WindowsIO) Create(file *File) error + func (w WindowsIO) Deleted(file *File) (bool, error) + func (w WindowsIO) GoTo(file *File, row uint32) error + func (w WindowsIO) OpenTable(config *Config) (*File, error) + func (w WindowsIO) ReadColumns(file *File) ([]*Column, *Column, error) + func (w WindowsIO) ReadHeader(file *File) error + func (w WindowsIO) ReadMemo(file *File, address []byte) ([]byte, bool, error) + func (w WindowsIO) ReadMemoHeader(file *File) error + func (w WindowsIO) ReadNullFlag(file *File, position uint64, column *Column) (bool, bool, error) + func (w WindowsIO) ReadRow(file *File, position uint32) ([]byte, error) + func (w WindowsIO) Search(file *File, field *Field, exactMatch bool) ([]*Row, error) + func (w WindowsIO) Skip(file *File, offset int64) + func (w WindowsIO) WriteColumns(file *File) (err error) + func (w WindowsIO) WriteHeader(file *File) (err error) + func (w WindowsIO) WriteMemo(file *File, raw []byte, text bool, length int) ([]byte, error) + func (w WindowsIO) WriteMemoHeader(file *File, size int) (err error) + func (w WindowsIO) WriteRow(file *File, row *Row) (err error)