ncruces

package module
v0.0.0-...-bf4cc38 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package ncruces provides a Zstandard VFS adapter for ncruces/go-sqlite3. This adapter enables read-only access to Zstandard-compressed SQLite databases using the pure Go WASM-based ncruces/go-sqlite3 driver.

Usage:

import _ "github.com/paulstuart/sqlitezstd/driver/ncruces"

db, err := sql.Open("sqlite3", "file:database.sqlite.zst?vfs=zstd")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZstdFile

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

ZstdFile represents an open Zstandard compressed database file for ncruces driver.

func (*ZstdFile) CheckReservedLock

func (z *ZstdFile) CheckReservedLock() (bool, error)

func (*ZstdFile) Close

func (z *ZstdFile) Close() error

func (*ZstdFile) DeviceCharacteristics

func (z *ZstdFile) DeviceCharacteristics() vfs.DeviceCharacteristic

func (*ZstdFile) Lock

func (z *ZstdFile) Lock(elock vfs.LockLevel) error

func (*ZstdFile) ReadAt

func (z *ZstdFile) ReadAt(p []byte, off int64) (int, error)

func (*ZstdFile) SectorSize

func (z *ZstdFile) SectorSize() int

func (*ZstdFile) Size

func (z *ZstdFile) Size() (int64, error)

func (*ZstdFile) Sync

func (z *ZstdFile) Sync(flag vfs.SyncFlag) error

func (*ZstdFile) Truncate

func (z *ZstdFile) Truncate(size int64) error

func (*ZstdFile) Unlock

func (z *ZstdFile) Unlock(elock vfs.LockLevel) error

func (*ZstdFile) WriteAt

func (z *ZstdFile) WriteAt(p []byte, off int64) (int, error)

type ZstdVFS

type ZstdVFS struct{}

ZstdVFS implements the VFS interface for Zstandard compressed databases.

func (*ZstdVFS) Access

func (z *ZstdVFS) Access(name string, flags vfs.AccessFlag) (bool, error)

Access checks whether a file exists and can be accessed with the specified permissions.

func (*ZstdVFS) Delete

func (z *ZstdVFS) Delete(name string, dirSync bool) error

Delete always returns an error indicating that the VFS is read-only.

func (*ZstdVFS) FullPathname

func (z *ZstdVFS) FullPathname(name string) (string, error)

FullPathname returns the full pathname of a file.

func (*ZstdVFS) Open

func (z *ZstdVFS) Open(name string, flags vfs.OpenFlag) (vfs.File, vfs.OpenFlag, error)

Open opens a compressed database file for reading.

Jump to

Keyboard shortcuts

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