Source File
api.go
Belonging Package
github.com/ncruces/go-sqlite3/vfs
// Package vfs wraps the C SQLite VFS API.package vfsimport ()// A VFS defines the interface between the SQLite core and the underlying operating system.//// Use sqlite3.ErrorCode or sqlite3.ExtendedErrorCode to return specific error codes to SQLite.//// https://sqlite.org/c3ref/vfs.htmltype VFS interface {Open(name string, flags OpenFlag) (File, OpenFlag, error)Delete(name string, syncDir bool) errorAccess(name string, flags AccessFlag) (bool, error)FullPathname(name string) (string, error)}// VFSFilename extends VFS with the ability to use Filename// objects for opening files.//// https://sqlite.org/c3ref/filename.htmltype VFSFilename interface {VFSOpenFilename(name *Filename, flags OpenFlag) (File, OpenFlag, error)}// A File represents an open file in the OS interface layer.//// Use sqlite3.ErrorCode or sqlite3.ExtendedErrorCode to return specific error codes to SQLite.// In particular, sqlite3.BUSY is necessary to correctly implement lock methods.//// https://sqlite.org/c3ref/io_methods.htmltype File interface {io.Closerio.ReaderAtio.WriterAtTruncate(size int64) errorSync(flags SyncFlag) errorSize() (int64, error)Lock(lock LockLevel) errorUnlock(lock LockLevel) errorCheckReservedLock() (bool, error)SectorSize() intDeviceCharacteristics() DeviceCharacteristic}// FileUnwrap should be implemented by a File// that wraps another File implementation.type FileUnwrap interface {FileUnwrap() File}// FileLockState extends File to implement the// SQLITE_FCNTL_LOCKSTATE file control opcode.//// https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntllockstatetype FileLockState interface {FileLockState() LockLevel}// FilePersistWAL extends File to implement the// SQLITE_FCNTL_PERSIST_WAL file control opcode.//// https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlpersistwaltype FilePersistWAL interface {FilePersistWAL() boolSetPersistWAL(bool)}// FilePowersafeOverwrite extends File to implement the// SQLITE_FCNTL_POWERSAFE_OVERWRITE file control opcode.//// https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlpowersafeoverwritetype FilePowersafeOverwrite interface {FilePowersafeOverwrite() boolSetPowersafeOverwrite(bool)}// FileChunkSize extends File to implement the// SQLITE_FCNTL_CHUNK_SIZE file control opcode.//// https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlchunksizetype FileChunkSize interface {FileChunkSize(size int)}// FileSizeHint extends File to implement the// SQLITE_FCNTL_SIZE_HINT file control opcode.//// https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlsizehinttype FileSizeHint interface {FileSizeHint(size int64) error}// FileHasMoved extends File to implement the// SQLITE_FCNTL_HAS_MOVED file control opcode.//// https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlhasmovedtype FileHasMoved interface {FileHasMoved() (bool, error)}// FileOverwrite extends File to implement the// SQLITE_FCNTL_OVERWRITE file control opcode.//// https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntloverwritetype FileOverwrite interface {FileOverwrite() error}// FileSync extends File to implement the// SQLITE_FCNTL_SYNC file control opcode.//// https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlsynctype FileSync interface {FileSyncSuper(super string) error}// FileCommitPhaseTwo extends File to implement the// SQLITE_FCNTL_COMMIT_PHASETWO file control opcode.//// https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlcommitphasetwotype FileCommitPhaseTwo interface {FileCommitPhaseTwo() error}// FileBatchAtomicWrite extends File to implement the// SQLITE_FCNTL_BEGIN_ATOMIC_WRITE, SQLITE_FCNTL_COMMIT_ATOMIC_WRITE// and SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE file control opcodes.//// https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlbeginatomicwritetype FileBatchAtomicWrite interface {FileBeginAtomicWrite() errorCommitAtomicWrite() errorRollbackAtomicWrite() error}// FileCheckpoint extends File to implement the// SQLITE_FCNTL_CKPT_START and SQLITE_FCNTL_CKPT_DONE// file control opcodes.//// https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlckptstarttype FileCheckpoint interface {FileCheckpointStart()CheckpointDone()}// FilePragma extends File to implement the// SQLITE_FCNTL_PRAGMA file control opcode.//// https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlpragmatype FilePragma interface {FilePragma(name, value string) (string, error)}// FileBusyHandler extends File to implement the// SQLITE_FCNTL_BUSYHANDLER file control opcode.//// https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlbusyhandlertype FileBusyHandler interface {FileBusyHandler(func() bool)}// FileSharedMemory extends File to possibly implement// shared-memory for the WAL-index.// The same shared-memory instance must be returned// for the entire life of the file.// It's OK for SharedMemory to return nil.type FileSharedMemory interface {FileSharedMemory() SharedMemory}// SharedMemory is a shared-memory WAL-index implementation.// Use [NewSharedMemory] to create a shared-memory.type SharedMemory interface {shmMap(context.Context, api.Module, int32, int32, bool) (ptr_t, _ErrorCode)shmLock(int32, int32, _ShmFlag) _ErrorCodeshmUnmap(bool)shmBarrier()io.Closer}type blockingSharedMemory interface {SharedMemoryshmEnableBlocking(block bool)}type fileControl interface {FilefileControl(ctx context.Context, mod api.Module, op _FcntlOpcode, pArg ptr_t) _ErrorCode}type filePDB interface {FileSetDB(any)}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |