Skip to content

Instantly share code, notes, and snippets.

@TheExGenesis
Created May 12, 2022 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheExGenesis/475f28528b8082e5ee21d8823e518abe to your computer and use it in GitHub Desktop.
Save TheExGenesis/475f28528b8082e5ee21d8823e518abe to your computer and use it in GitHub Desktop.
schema and transaction
(def filesystem-schema
[;; filesystem
{:db/ident :fs/parent
:db/valueType :db.type/ref
:db/cardinality :db.cardinality/one}
{:db/ident :fs/name
:db/valueType :db.type/string
:db/index true
:db/cardinality :db.cardinality/one
:db/isComponent true}
{:db/ident :fs/path
:db/valueType :db.type/string
:db/index true
:db/unique :db.unique/identity
:db/cardinality :db.cardinality/one
:db/isComponent true}
;; file
{:db/ident :file/ext
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one
:db/isComponent true}
{:db/ident :file/created
:db/valueType :db.type/instant
:db/cardinality :db.cardinality/one
:db/isComponent true}
{:db/ident :file/modified
:db/valueType :db.type/instant
:db/cardinality :db.cardinality/one
:db/isComponent true}
{:db/ident :file/bytes
:db/valueType :db.type/long
:db/cardinality :db.cardinality/one
:db/isComponent true}])
({:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem",
:fs/name "filesystem"}
{:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem/a",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem/a",
:fs/name "a",
:fs/parent "/home/genesis/Documents/homebase/datasets/local/filesystem"}
{:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem/a/test_a.txt",
:fs/name "test_a.txt",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem/a/test_a.txt",
:fs/parent "/home/genesis/Documents/homebase/datasets/local/filesystem/a",
:file/ext ".txt",
:file/modified #inst "2022-05-10T14:53:25.857-00:00",
:file/created #inst "2022-05-10T14:53:25.857-00:00",
:file/bytes 0}
{:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem/a/2",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem/a/2",
:fs/name "2",
:fs/parent "/home/genesis/Documents/homebase/datasets/local/filesystem/a"}
{:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem/a/1",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem/a/1",
:fs/name "1",
:fs/parent "/home/genesis/Documents/homebase/datasets/local/filesystem/a"}
{:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem/a/1/y",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem/a/1/y",
:fs/name "y",
:fs/parent "/home/genesis/Documents/homebase/datasets/local/filesystem/a/1"}
{:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem/a/1/test_a_1.txt",
:fs/name "test_a_1.txt",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem/a/1/test_a_1.txt",
:fs/parent "/home/genesis/Documents/homebase/datasets/local/filesystem/a/1",
:file/ext ".txt",
:file/modified #inst "2022-05-08T15:12:37.183-00:00",
:file/created #inst "2022-05-08T15:12:37.183-00:00",
:file/bytes 0}
{:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem/a/1/x",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem/a/1/x",
:fs/name "x",
:fs/parent "/home/genesis/Documents/homebase/datasets/local/filesystem/a/1"}
{:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem/a/1/x/test_a_1_x.txt",
:fs/name "test_a_1_x.txt",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem/a/1/x/test_a_1_x.txt",
:fs/parent "/home/genesis/Documents/homebase/datasets/local/filesystem/a/1/x",
:file/ext ".txt",
:file/modified #inst "2022-05-10T14:31:13.577-00:00",
:file/created #inst "2022-05-10T14:31:13.577-00:00",
:file/bytes 9}
{:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem/a/kek.txt",
:fs/name "kek.txt",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem/a/kek.txt",
:fs/parent "/home/genesis/Documents/homebase/datasets/local/filesystem/a",
:file/ext ".txt",
:file/modified #inst "2022-05-11T21:48:26.407-00:00",
:file/created #inst "2022-05-11T21:48:26.407-00:00",
:file/bytes 0}
{:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem/b",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem/b",
:fs/name "b",
:fs/parent "/home/genesis/Documents/homebase/datasets/local/filesystem"}
{:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem/b/2",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem/b/2",
:fs/name "2",
:fs/parent "/home/genesis/Documents/homebase/datasets/local/filesystem/b"}
{:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem/b/1",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem/b/1",
:fs/name "1",
:fs/parent "/home/genesis/Documents/homebase/datasets/local/filesystem/b"}
{:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem/b/3",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem/b/3",
:fs/name "3",
:fs/parent "/home/genesis/Documents/homebase/datasets/local/filesystem/b"}
{:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem/d",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem/d",
:fs/name "d",
:fs/parent "/home/genesis/Documents/homebase/datasets/local/filesystem"}
{:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem/c",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem/c",
:fs/name "c",
:fs/parent "/home/genesis/Documents/homebase/datasets/local/filesystem"}
{:db/id "/home/genesis/Documents/homebase/datasets/local/filesystem/c/test_c.txt",
:fs/name "test_c.txt",
:fs/path "/home/genesis/Documents/homebase/datasets/local/filesystem/c/test_c.txt",
:fs/parent "/home/genesis/Documents/homebase/datasets/local/filesystem/c",
:file/ext ".txt",
:file/modified #inst "2022-05-08T15:12:24.843-00:00",
:file/created #inst "2022-05-08T15:12:24.843-00:00",
:file/bytes 0})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment