Commit 0165b615 authored by Michael Raskin's avatar Michael Raskin
Browse files

Syncing from Monotone at 20200602-003006. Last commit message was Copy some content from slides

parent ec6ffebe
query-fs
========
It is a mirror of QueryFS monotone repository. QueryFS is stable enough that difference is minimal, but the true repository is in Monotone: http://mtn-host.prjek.net/viewmtn/cl-fuse/branch/changes/com.ignorelist.401a0bf1.raskin.cl-fuse.query-fs
To run a minimal test, create /tmp/test-query-fs/ and copy example-queries as
queries there, and example-plugins as plugins. Then load query-fs and run
(query-fs:run-fs :target "/tmp/test-query-fs/")
in your Common Lisp REPL. Example command for SBCL and Quicklisp:
sbcl --load setup.lisp --eval '(quicklisp:quickload :query-fs)' --eval '(query-fs:run-fs :target "/tmp/test-query-fs/")' --eval '(quit)'
To run a minimal test, create /tmp/test-query-fs/ and copy example-queries as
queries there, and example-plugins as plugins. Then load query-fs and run
Query-FS is a virtual filesystem implemented using FUSE in Common Lisp.
Its current main usecase is providing a POSIX FS API to access and modify some
data in SQL databases.
(query-fs:run-fs :target "/tmp/test-query-fs/")
One can write:
in your Common Lisp REPL. Example command for SBCL and Quicklisp:
mkdir "all" do
for x in "select name, content from test_table"
with-file $name do
on-read $x[1]
on-write data "update test_table set content = ${data} where name = ${name}"
on-remove "delete from test_table where name = ${name}"
done
on-create-file name "insert into test_table (name) values (${name})"
done
sbcl --load setup.lisp --eval '(quicklisp:quickload :query-fs)' --eval '(query-fs:run-fs :target "/tmp/test-query-fs/")' --eval '(quit)'
and browse and modify a DB table as a directory.
One can also write some queries in Common Lisp:
(mk-pair-generator x
(let ((xn (ignore-errors (parse-integer (first x)))))
(if xn `((,(first x) ,(1+ xn)))
(loop for k from 1 to 10 collect `(,(format nil "~a" k) ,(1+ k)))))
(mk-file (first x) (format nil "~a" (second x))))
Installation and use:
$ cd ~/quicklisp/local-projects
$ git clone https://gitlab.common-lisp.net/cl-fuse/query-fs
$ mkdir -p query-fs-test/queries
$ $EDITOR query-fs-test/queries/…
* (ql:quickload :query-fs)
* (query-fs:run-fs :target "query-fs-test")
See example queries in example-queries and clsql-queries
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment