vilterp / treesql

prototype: a relational database which supports live GraphQL-like queries. Written in Go with BoltDB storage.
37 stars 1 forks source link

TreeSQL

logo

A proof of concept of a database which:

Currently uses BoltDB as a storage layer.

Docker Hub

Syntax

MANY blog_posts {
  id,
  title,
  body,
  comments: MANY comments {
    id,
    author: ONE users {
      name
    },
    body
  }
}

Example

localhost:9000> MANY blog_posts { id, title, body, comments: MANY comments { id, author: ONE users { name }, body } }
[
  {
    "id": "0",
    "title": "inserting stuff?",
    "body": "idk maybe it will work",
    "comments": [
      {
        "id": "0",
        "author": {
          "name": "Pete"
        },
        "body": "fa la la la la comment"
      }
    ]
  },
  {
    "id": "11",
    "title": "whooo",
    "body": "k seem to have writes",
    "comments": [
      {
        "id": "44",
        "author": {
          "name": "Pete"
        },
        "body": "whaddup"
      }
    ]
  }
]
localhost:9000>

Requirements

Use the docker version, or:

Installation

Use the docker version or:

Usage

cd $GOPATH/src/github.com/vilterp/treesql, then:

Start the server:

$ make start

Browse to http://localhost:9000/ and type in queries in the Web UI; e.g.:

many blog_posts { title, comments: many comments { body } } live

More examples live in test_script.treesql.