sqlitefs

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS struct {
	// contains filtered or unexported fields
}

func New

func New(file path.Local, opts ...Option) (*FS, error)

New creates a new filesystem, based on a sqlite database that resides in a local file file is the location of the database file. After usage, you must call the Close() method in order to close the connection.

func NewInMemory

func NewInMemory(abs path.Absolute, opts ...Option) (*FS, error)

func (*FS) Abs

func (m *FS) Abs(r path.Relative) path.Absolute

func (*FS) Close

func (f *FS) Close() error

func (*FS) Delete

func (fsys *FS) Delete(p path.Relative, recursive bool) (err error)

func (*FS) Exists

func (fsys *FS) Exists(p path.Relative) bool

func (*FS) ModTime

func (fsys *FS) ModTime(p path.Relative) (t time.Time, err error)

func (*FS) Reader

func (fsys *FS) Reader(p path.Relative) (io.ReadCloser, error)

func (*FS) Size

func (fsys *FS) Size(file path.Relative) int64

func (*FS) Write

func (fsys *FS) Write(p path.Relative, rd io.ReadCloser, inbetween bool) (err error)

type Option

type Option func(*FS)

Option is an option for the dbfs

func OptBlobTable

func OptBlobTable(name string) Option

OptBlobTable sets the name of the blob table

func OptCreateTables

func OptCreateTables() Option

OptCreateTables sets the option for creating/initializing the tables (always the default for in memory databases)

func OptFileTable

func OptFileTable(name string) Option

OptFileTable sets the name of the file table

func OptSqliteFlags

func OptSqliteFlags(flags ...sqlite.OpenFlags) Option

OptSqliteFlags sets the flags of the underlying sqlite db

Jump to

Keyboard shortcuts

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