Skip to content

Canner/vulcan-sql

Folders and files

NameName
Last commit message
Last commit date
Aug 23, 2022
Apr 27, 2022
Sep 13, 2022
Sep 21, 2022
Sep 13, 2022
Sep 13, 2022
Apr 27, 2022
Aug 18, 2022
Sep 6, 2022
Apr 27, 2022
Apr 27, 2022
Aug 9, 2022
Sep 8, 2022
Aug 23, 2022
Apr 27, 2022
Jul 13, 2022
Jul 13, 2022
Aug 19, 2022
Sep 15, 2022
Sep 13, 2022
Sep 13, 2022
Sep 15, 2022

Repository files navigation

πŸš€ Release in Sep 2022.

Why VulcanSQL

⚑️ Data analyst / analytical engineers’ time should focus on important matters like data transformation and communicating with data consumers on high level.

Data analysts and analytical engineers often take lots of time helping data consumers. Backend engineers who build internal dashboards will ask about data catalog, documentations and if there are any APIs they can directly use. Business users will ask what data they can use to achieve their goals, and how to get data to their spreadsheet or excel.

With VulcanSQL, we prepare what data consumers need for you. Imagine you can unify the data access by building APIs instantly with just SQL. Authorization, validation, pagination features work out of the box.

VulcanSQL also builds documentations and a self-serve catalog, so data consumers can understand the data and get data from the tools they’re using all by themselves without using any SQL.

Features

  • Build API instantly with just SQL.
  • Access control & authorization in SQL.
  • API best practices included (validation, caching, pagination, sorting, etc).
  • API documentation is automatically built.
  • Self-serve API catalog for data consumers. A step-by-step guide to get data from Excel / Google spreadsheet, Zapier, Retool, etc.

How VulcanSQL works?

Step 1: Instant API with just SQL.

Building API with just SQL. No complex web framework and business logic.

Example: passing parameters from url

select * from public.users where id = '{{ params.userId }}'

You can build an API endpoint users with userId as input.

API users will be able to get data like

GET /users?userId=1

Response
[{
  "name": "wwwy3y3",
  "age": 30
}]

Other Examples:

1. Error Handling

If you want to throw errors based on data, for example, run a query first, if no data return, throw 404 not found.

{% req user %}
select * from public.users where userName = '{{ parames.userName }}';
{% endreq %}

{% if user.count().value() == 0 %}
  {% error "user not found" %}
{% endif %}

select * from public.groups where userId = '{{ user.value()[0].id }}';
2. Authorization

You can pass in user attributes to SQL to control the access.

select
  --- masking address if query user is not admin
  {% if context.user == 'ADMIN' %}
    {% "address" %}
  {% elif %}
    {% "masking(address)" %}
  {% endif %},
  
  orderId,
  amount
from orders

--- limit the data to the store user belongs to.
where store = {{ context.user.store }}
3. Validation

You can add a number validator on userId input on your API with schema.

  • SQL

    select * from public.users where id = '{{ params.userId }}'
  • Schema

    parameters:
      userId:
        in: query
        valudators:
          - name: 'number'

Step 2: Build self-serve documentation and catalog

VulcanSQL will automatically build documentation and catalog.

  • Catalog: VulcanSQL will build a catalog page for data consumers. This page will consist of more clear information on data that is exposed as APIs. Description, Column information are all included.

  • API Documentation: VulcanSQL will build a swagger page for backend engineers.

Step 3: Connect from framework & applications

On API catalog page, you can preview data here and connect from your own framework and applications.

  • You can Copy API URL to use it at frontend / backend.
  • You can download the selected data as CSV or JSON.

  • You can follow the steps to connect from Excel / Google Spreadsheet / Zapier / Retools.

Installation

  • npm / yarn

    npm install @vulcan-sql/cli
    yarn add @vulcan-sql/cli
  • brew

    brew install vulcan-sql

Quickstart

  1. Initialize a VulcanSQL project

    vulcan init --name my-first-vulcan-project && cd my-first-vulcan-project
  2. Start VulcanSQL server.

    vulcan start --watch
  3. Visit API & Catalog

    Vulcan started...
    Visit API document at http://localhost:8080/doc
    Visit Catalog at http://localhost:8080/catalog

Demo Screenshot

πŸ”‘ Login Page: data consumers will be asked to authenticate themselves.

πŸ“– Catalog: After logged-in, data consumers can see what endpoints are available to be used.

βœ… Endpoint: data consumers can view the details of one endpoint and preview the data.

πŸ”Œ Connect: data consumers will be able to follow the guide and connect from their applications.

Community