Stickshift is a fast and efficient
interface that helps you analyze your data in SQL. We built it for Mapbox’s
internal metrics data, and today we are releasing it as open source
so everyone can take a closer look at their data warehouses.
Building Stickshift gave
us a chance to experiment with new ways of sharing queries, visualizing results,
and getting data, so it has a few neat features both inside and out.
Stickshift allows you to save SQL queries and share them with your team so you can easily ask the same questions again and again without retyping each time. The queries are stored
within a GitHub repository using Hubdb,
a simple wrapper around the GitHub API.
Results are displayed in a table first and charts whenever possible.
If your data appears to contain dates or numeric values, we automatically generate a visualization of stacked bars, similar to how charted visualizes data.
You can also export query results as JSON or CSV with one click to customize
their visualization or open them in a spreadsheet application like Excel.
Stickshift doesn’t connect to SQL directly: it interacts with any server
that abstracts querying to a matter of pushing and pulling JSON data. We’ve included
an example server that connects to SQLite using Mapbox’s node-sqlite3 module,
and internally we use a server that connects to Postgres using the pg module. Interacting with any other database is as simple as switching modules and
tweaking the query code.
We hope Stickshift is also a good example of several new technologies working
well together. The UI is built with React,
and React-Router. It’s written
in CommonJS and ES6 and cross-compiled with browserify
and 6to5. The charts are powered by Vega,
a fascinating declarative library for visualization.
Try it out: Stickshift
is an open project on GitHub and we welcome contributions.