Giter VIP home page Giter VIP logo

dbsheets's Introduction

DBSheets

DBSheets is a simple in-memory query engine that allows you to retrieve filter, project and join data coming from MongoDB and PostgreSQL data sources.

Configuration

In the `etc/config.yml' file you can configure multiple connections to databases that you will reuse within the "sheets".

example:

datasources:
    mongo1:
        url: mongodb://localhost
    postgres1:
        host: '127.0.0.1'
        database: 'foobar'
        user: foobar

In this example we define two databases, describe their connection details and assign them the keys mongo1 and postgres1.

The Sheets

The sheets are composed of two top items:

  • variables: the sheet can be parametrized with variables that are evaluated at run time. The variables block will allow you to declare which variables the program will need before executing the sheet.
  • steps: the steps of the sheet, describing the operations that need to be done

Steps

Example sheets can be found in the sheets/ directory. The steps can be subdivded between data sources and actions:

Data sources

  • mongodb: a MongoDB data source
  • postgres: a PostgreSQL data source
  • joined: a data source that joins two existing data sources
  • public: a data source that takes an existing data source, perform some adjustments on field names, and exposes it

Actions

  • comment: prints a comment in the terminal. For debug purposes
  • setVar: sets a variable

Running

The application can run in two modes:

  • command line: the output will be presented in the shell and the program will exit once the operation is finished. This is the default mode.
  • server: by issuing the -S flag, a web server will be activated on port 5000. The web server allows the execution of arbitrary sheets.

All options are available in the help screen of the application.

Docker

The simplest way to run DBSheets is using Docker.

docker run --rm -p 5000:5000 -v `pwd`/etc:/usr/src/app/etc -v `pwd`/sheets:/usr/src/app/sheets -ti theirish81/dbsheets [args]

where pwd, if you're not a *Nix user, is the current directory. [args] is a place holder for command line arguments. Leave it empty to see the help.

If you're a *Nix user, the script run.sh will do exactly this for you.

dbsheets's People

Contributors

theirish81 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.