Skip to content

prototype: a relational database which supports live GraphQL-like queries. Written in Go with BoltDB storage.

Notifications You must be signed in to change notification settings

vilterp/treesql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

fa1d7f3 · Dec 3, 2022
May 18, 2018
Mar 28, 2018
Mar 3, 2018
May 18, 2018
Nov 6, 2019
Mar 2, 2018
Mar 21, 2018
Feb 10, 2018
Nov 6, 2019
Apr 19, 2019
Dec 3, 2022
Apr 19, 2019
Apr 19, 2019
Nov 6, 2019
Mar 28, 2018

Repository files navigation

TreeSQL

logo

A proof of concept of a database which:

  • Is relational (has tables with typed columns and foreign keys)
  • Has a tree-structured query language
  • Returns tree-structured results
  • Can push live updates to those result trees

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:

  • Go 1.10
  • Node 6.9 & NPM 3.10
  • godep (install with go get github.com/tools/godep)

Installation

Use the docker version or:

  • go get github.com/vilterp/treesql
  • cd $GOPATH/src/github.com/vilterp/treesql
  • $ make deps
  • $ make

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.

About

prototype: a relational database which supports live GraphQL-like queries. Written in Go with BoltDB storage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages