GithubHelp home page GithubHelp logo

logo
badge1 badge2 badge3 badge4

Deploy, manage and query cloud resources and interact with APIs using SQL

Read the docs »
Raise an Issue · Request a Feature · Developer Guide · BYO Providers

Contents
  1. About The Project
  2. Installation
  3. Usage
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgements

About The Project

StackQL is an open-source project built with Golang that allows you to create, modify and query the state of services and resources across different cloud and SaaS providers (Google, AWS, Azure, Okta, GitHub, etc.) using SQL semantics

stackql-shell stackql-shell

How it works

StackQL is a standalone application that can be used in client mode (via exec or shell) or accessed via a Postgres wire protocol client (psycopg2, etc.) using server mode (srv).

StackQL parses SQL statements and transpiles them into API requests to the cloud provider. The API calls are then executed and the results are returned to the user.

StackQL provider definitions are defined in OpenAPI extensions to the providers specification. These definitions are then used to generate the SQL schema and the API client. The source for the provider definitions are stored in the StackQL Registry.

StackQL Context Diagram
The following context diagram describes the StackQL architecture at a high level:
flowchart LR
  subgraph StackQL
    direction BT
    subgraph ProviderDefs
        Registry[Provider Registry Docs]    
    end
    subgraph App
        Proc[$ stackql exec\n$ stackql shell\n$ stackql srv]
        style Proc fill:#000,stroke:#000,color:#fff,text-align:left;

        %% ,font-family:'Courier New', Courier, monospace
    end
  end
  User((User)) <--> StackQL <--> Provider[Cloud Provider API]
  ProviderDefs --> App

More detailed design documentation can be found in the here.

Installation

StackQL is available for Windows, MacOS, Linux, Docker, GitHub Actions and more. See the installation instructions below for your platform.

Installing on MacOS
  • Homebrew (amd64 and arm64)
    • brew install stackql or brew tap stackql/tap && brew install stackql/tap/stackql
  • MacOS PKG Installer (amd64 and arm64)
Installing on Windows
  • MSI Installer
  • Chocolatey
  • ZIP Archive
    • download the latest Windows ZIP archive for StackQL
    • extract the archive (code signed stackql.exe file) to a directory of your choice
    • add the directory to your PATH environment variable (optional)
Installing on Linux
  • ZIP Archive
    • download the latest Linux ZIP archive for StackQL
      • or via curl -L https://bit.ly/stackql-zip -O && unzip stackql-zip
    • extract the archive (stackql file) to a directory of your choice
    • add the directory to your PATH environment variable (optional)
Getting StackQL from DockerHub

View all available StackQL images on DockerHub. Images available include stackql, stackql-jupyter-demo and more. Pull the latest StackQL base image using:

docker pull stackql/stackql
Using StackQL with GitHub Actions

Use StackQL in your GitHub Actions workflows to automate cloud infrastructure provisioning, IaC assurance, or compliance/security. Available GitHub Actions include: setup-stackql, stackql-exec and more

Usage

StackQL can be used via the interactive REPL shell, or via the exec command or ran as a server using the Postgres wire protocol.

ℹ️ StackQL does not require or install a database.

  • Interactive Shell

    # run interactive stackql queries
    stackql shell --auth="${AUTH}"
  • Execute a statement or file

    stackql exec --auth="${AUTH}" -i myscript.iql --iqldata vars.jsonnet --output json
    
    # or
    
    stackql exec --auth="${AUTH}" "SELECT id, status FROM aws.ec2.instances WHERE region = 'us-east-1'"

    ℹ️ output options of json, csv, table and text are available for the exec command using the --output flag

    ℹ️ StackQL supports passing parameters using jsonnet or json, see Using Variables

  • Server

    # serve client requests over the Postgres wire protocol (psycopg2, etc.) 
    stackql srv --auth="${AUTH}"

For more examples, please check our Blog

Contributing

Contributions are welcome and encouraged. For more information on how to contribute, please see our contributing guide.

License

Distributed under the MIT License. See LICENSE for more information. Licenses for third party software we are using are included in the /docs/licenses directory.

Contact

Get in touch with us via Twitter at @stackql, email us at [email protected] or start a conversation using discussions.

Acknowledgements

Forks of the following support our work:

We gratefully acknowledge these pieces of work.

StackQL Studios's Projects

generate-types icon generate-types

Deno module to generate a TypeScript types module file from JSON data (or a parsed JSON string).

okta-pkce-login icon okta-pkce-login

Command line utility to authenticate to an OIDC application using PKCE

openapisaurus icon openapisaurus

Deno based openapi document utility for splitting openapi spec and generating stackql providers

psql-wire icon psql-wire

PostgreSQL server wire protocol. Build your own server and start serving connections.

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.