Simple filesystem based key/value db. Provided as golang lib.
Find a file
Arnas Udovic 785c07dcf5
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
fix tests
2025-07-11 21:06:20 +03:00
testdata Init, Get, GetNode, Inc, Dec 2024-07-18 12:40:53 +03:00
.drone.yml drone 2024-07-18 22:44:12 +03:00
.gitignore Init, Get, GetNode, Inc, Dec 2024-07-18 12:40:53 +03:00
CHANGELOG fix GetRandomNode 2025-03-16 21:22:31 +02:00
command.go fix tests 2025-07-11 21:06:20 +03:00
go.mod abcex up 2025-01-07 08:41:12 +02:00
go.sum abcex up 2025-01-07 08:41:12 +02:00
LICENSE Initial commit 2024-07-17 13:48:34 +00:00
README.md add commands to be executed as script 2025-07-10 21:53:25 +03:00
zordfsdb.go fix tests 2025-07-11 21:06:20 +03:00
zordfsdb_test.go fix tests 2025-07-11 21:06:20 +03:00

zordfsdb

Build Status

Simple filesystem based key/value db. Provided as golang lib. Main idea is that user knows structure and gets value from known path. For operations that should search or do more should be used Nodes (golang structure).

Configuration

Init root directory.

Supported command

Commands can be split into value layer when you know the structure and node layer for deaper operations.

value layer commands

  • Get - to get value from path
  • Save - update or create value. Depends on path. If path directs into not existing parent object - will return false
  • Inc - increase abcex value
  • Dec - decrease abcex value
  • Now - save current datetime

node layer commands

  • GetNode - to get node. It can be object, list or value object. Returns false if not exist
  • CreatNode - create list (director) to add many same objects (structure should be controlled by user) or single object. Parent Node should exist
  • AddObject - add object to given list. Should assign abcex id
  • Length - get length of list
  • GetRandomNode - get random object from list

Node as Object commands

  • Node.Get - get object property value
  • Node.GetNodes - get object properties
  • Node.FixType - checks and sets object/list type

helper commands

  • Del - delete value, object or list by given path
  • Keys - return possible keys for object or ids for list
  • ExecuteCommands - execute commands separated by semicolon. See Commands section

dictionary

  • object - directory of key/value
  • list - directory of objects named by abcex as key
  • path - path to key or object or list

Commands

DB can run one or many commands separated by semicolon. Same commands are used in template to add new list object.

  • KEYS [path] - get list of existing properties/objects/lists
  • GET [path] - get value of property
  • INC [path] - increase abcex value in property
  • DEC [path] - decrease abcex value in property
  • NOW [path] - set value to datetime string in property
  • DEL [path] - remove property/object/list (no confirmation)
  • SAVE [path] [value] - set value to property
  • CREATE [path] - create list/object in path (parent path should exist)
  • ADD [path] - add abcex indexed object to list. Will return index
  • INFO [path] - get all info about property/object/list
  • TREE [path] - draw db part in path with values
  • HELP - will print this help
  • QUIT - exit the shell

Last used path can be accessed by _

Last returned index (after ADD command) can be accessed by $

Short commands can be as:

KEYS(\K), GET(\G), INC(\I), DEC(\D), NOW(\N), DEL(\R), SAVE(\S), CREATE(\C), ADD(\A), HELP(\H), QUIT(\Q)

DEV

Run tests: $ go test