Giter Club home page Giter Club logo

queryhammer's Introduction

QueryHammer

QueryHammer is an ongoing project to create a visual tool that helps you specify data queries interactively.

Motivation

Existing database systems usually use text-based query language for data retrieval. There are basically two ways how you can specify your query:

  • text based languages
    • flexible
    • but time consuming to learn
  • graphical interfaces
    • intutive, small learning curve
    • but offer limited functuonality
    • hand-crafted - when the new specification is released, these tools need to be updated manually (and that is why they usually offer limited functionality)

The goal of this tool is to combine best of both approaches and work universally for different query languages.

Progress report

Approach 1 - Automatic transformation of grammars

The first pass was by using a formal grammar of the query language (in EBNF or similar format) and generate user interface from it. While having the advantage to be compatible with full feature-set, this approach turned out not viable for several reasons:

  • Grammars for complicated languages are usually not complete, automatic parsing fails.
  • Grammars have many low-level rules which make the final UI complicated and not user friendly.

Approach 2 - Handcrafted custom UI

Second pass took opposite direction. The idea was not to use a grammar but to build the UI more like a traditional app from components using React. This has advantages that UI can be more tailored and customized. However, it is less formal and has limited set of features because of it.

Here is a work-in-progress example of an interface for generating SPARQL queries:

Example UI for generating SPARQL queries

Approach 3 - Grammars again (Kaptain)

I found a cool tool called Kaptain which takes a grammar file and generates graphical UI using Qt4. It is very similar concept I had in mind. User can fill in the values and the tool generates the final textual query. The tool is language agnostic. There are special annotations to control layout and input data types.

I've experimented with Kaptain to create UI to help build SQL queries (INSERT, UPDATE and DELETE):

Insert query Update query Delete query

And slightly more complicated SELECT query:

Select query

There is also a cool example showing how to generate single purpose UI for database access. Although it is a very interesting approach the tool has some limitations:

  • No support recursion.
  • Rules cannot occur multiple times (e.g. if tabbed interface, we cannost share where_clause rule in select, update and others).
  • Default values for choices (| operator) cannot be specified. Also default state for optional rules cannot be specified.
  • No web interface.
  • Extending with additional functionality of customizing UI would be difficult.

Future work

For the next pass I would like to combine advantages of approach 2 and 3. To have a system that is formally expressive as grammars, but is written as React components that would allow easy customization.

queryhammer's People

Contributors

dundalek avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.