MCPcopy Index your code
hub / github.com/superfly/litefs

github.com/superfly/litefs @v0.5.14 sqlite

repository ↗ · DeepWiki ↗ · release v0.5.14 ↗
968 symbols 3,834 edges 57 files 521 documented · 54%
README

LiteFS GitHub release (latest by date) Status GitHub ======

LiteFS is a FUSE-based file system for replicating SQLite databases across a cluster of machines. It works as a passthrough file system that intercepts writes to SQLite databases in order to detect transaction boundaries and record changes on a per-transaction level in LTX files.

This project is actively maintained but is currently in a beta state. Please report any bugs as an issue on the GitHub repository.

You can find a Getting Started guide on LiteFS' documentation site. Please see the ARCHITECTURE.md design document for details about how LiteFS works.

SQLite TCL Test Suite

It's a goal of LiteFS to pass the SQLite TCL test suite, however, this is currently a work in progress. LiteFS doesn't have database deletion implemented yet so that causes many tests to fail during teardown.

To run a test from the suite against LiteFS, you can use the Dockerfile.test to run it in isolation. First build the Dockerfile:

docker build -t litefs-test -f Dockerfile.test .

Then run it with the filename of the test you want to run. In this case, we are running select1.test:

docker run --device /dev/fuse --cap-add SYS_ADMIN -it litefs-test select1.test

Contributing

LiteFS contributions work a little different than most GitHub projects. If you have a small bug fix or typo fix, please PR directly to this repository.

If you would like to contribute a feature, please follow these steps:

  1. Discuss the feature in an issue on this GitHub repository.
  2. Create a pull request to your fork of the repository.
  3. Post a link to your pull request in the issue for consideration.

This project has a roadmap and features are added and tested in a certain order. Additionally, it's likely that code style, implementation details, and test coverage will need to be tweaked so it's easier to for me to grab your implementation as a starting point when implementing a feature.

Extension points exported contracts — how you extend this code

Stream (Interface)
Stream represents a stream of frames. [6 implementers]
client.go
Leaser (Interface)
Leaser represents an API for obtaining a lease for leader election. [3 implementers]
lease.go
Environment (Interface)
Environment represents an interface for interacting with the host environment. [2 implementers]
litefs.go
BackupClient (Interface)
(no doc) [2 implementers]
backup_client.go
StreamFrame (Interface)
(no doc) [12 implementers]
client.go
Lease (Interface)
Lease represents an acquired lease from a Leaser. [3 implementers]
lease.go
OS (Interface)
OS represents an interface for os package calls so they can be mocked for testing. [2 implementers]
litefs.go
Client (Interface)
Client represents a client for connecting to other LiteFS nodes. [2 implementers]
client.go

Core symbols most depended-on inside this repo

Close
called by 209
lease.go
Run
called by 141
cmd/litefs/run.go
OpenSQLDB
called by 117
internal/testingutil/testingutil.go
Unlock
called by 86
db.go
DB
called by 71
store.go
Name
called by 71
db.go
Lock
called by 56
rwmutex.go
String
called by 49
litefs.go

Shape

Method 632
Function 230
Struct 89
Interface 9
TypeAlias 8

Languages

Go100%

Modules by API surface

db.go129 symbols
store.go96 symbols
litefs.go74 symbols
cmd/litefs/mount_test.go43 symbols
client.go40 symbols
lease.go39 symbols
fuse/root_node.go25 symbols
consul/consul.go25 symbols
fuse/database_node.go24 symbols
cmd/litefs/mount_linux.go24 symbols
http/server.go23 symbols
fuse/file_system_test.go23 symbols

Dependencies from manifests, versioned

bazil.org/fusev0.0.0-2023012000273 · 1×
github.com/armon/go-metricsv0.3.10 · 1×
github.com/beorn7/perksv1.0.1 · 1×
github.com/cespare/xxhash/v2v2.1.2 · 1×
github.com/hashicorp/go-cleanhttpv0.5.1 · 1×
github.com/hashicorp/go-hclogv0.14.1 · 1×
github.com/hashicorp/go-immutable-radixv1.3.0 · 1×
github.com/hashicorp/go-msgpackv0.5.5 · 1×

For agents

$ claude mcp add litefs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact