A fuse filesystem that stores data on an SQL dbs.
By default, this creates a sqlite database named fs.sql
in the current directory. To know more or use other sql dbs, run sqlfs
.
go install github.com/yoogottamk/sqlfs@latest
mkdir mnt
# initialize the db
sqlfs init
# mounts the fuse fs
sqlfs mount
# keep this running^
# open a new terminal and
cd mnt
# create, remove files and dirs, read and write files, ...
# ... after you're done, run:
umount mnt
- divide file contents into blocks
- symlinks
- figure out logging
.
,..
in directory listing (cd ..
works but.
,..
aren't shown inls -a
)- more extensive tests [have basic e2e file and dir operations being tested right now, need to verify stuff at sql tables level]
^listed in the order of priority
Why not? 🙃
Some documentation is provided in the long description of sqlfs
itself. This section aims to document how I tested my implementation.
docker run --rm -it --name sqlfs-mariadb \
-e MARIADB_USER=user \
-e MARIADB_PASSWORD=password \
-e MARIADB_DATABASE=sqlfs \
-e MARIADB_RANDOM_ROOT_PASSWORD=yes \
-p 3306:3306 \
mariadb:latest
mkdir mnt
sqlfs init -u mysql://user:password@/sqlfs
sqlfs mount -u mysql://user:password@/sqlfs mnt
docker run --rm -it --name sqlfs-postgres \
-e POSTGRES_USER=user \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=sqlfs \
-p 5432:5432 \
postgres:latest
mkdir mnt
sqlfs init -u postgres://user:password@localhost:5432/sqlfs
sqlfs mount -u postgres://user:password@localhost:5432/sqlfs mnt
I'm new with golang and fuse and this is my first big-ish project in this language. The code might have bugs and definitely has performance issues (e.g. loading the entire file into memory during read). There was one time in early development when I called InvalidateEntry
with some arguments and had to reboot my laptop in order to get it to work again (no such inconvenience was experienced after that).
Don't use it for critical applications.