Stackql - The New Approach To Querying And Provisioning Cloud Services |
Written by Nikos Vaggalis | |||
Wednesday, 12 March 2025 | |||
Or "Use SQL For Everything Part 2". Like the previously covered Steampipe tool, Stackql enables the use of SQL for querying everything too, but with a twist. In Steampipe - SQL For Everything we discovered Steampipe, a tool that renders SQL as the main query language Steampipe did just that; it enables a uniform data access method for querying Cloud providers and Cloud-based services and it did that by leveraging PostgreSQL and its Foreign Data Wrappers to present the various data sources as database tables that interface with the external APIs through Plugins. Stackql then is another tool with the same capabilities and beyond but with much lighter infrastructure requirements. Unlike Steampipe, Stackql is a standalone dev tool which doesn't require a Postgres DB, isn't FDW based and its Cloud providers are defined in OpenAPI extensions. These definitions are then used to generate the SQL schema and the API client, for StackQL to parse the issued SQL statements and transpile them into API requests to the cloud provider. The API calls are then executed and the results are returned to the user. As such StackQL can be used for:
The Cloud providers it supports are stored in the Registry which can be interogated by issuing REGISTRY LIST, which brings REGISTRY PULL google; you can now for instance select all resources deployed within a service using a basic SELECT statement: SELECT * FROM google.compute.instances This according to the object based resource system which StackQL is based of: This hierarchy is expressed in the object notation <provider>.<service>.<resource> within the context of a given provider However Stackql goes beyond SELECTs. With it you can have full support for lifecycle ops (like starting and stopping VMs) and mutation ops like creating instances, functions, buckets, etc. For instance let's create a new instance of a resource. -- Create a Compute Engine Disk resource Its language specification consists of the following key terms:
EXEC in particular is most useful since it executes a provider resource method like -- Stop a running Compute Engine resource instance By mixing its object system with SQL, you can leverage the usual SQL functions to query and manipulate your Cloud environment:
Cloud providers aside, StackQL also supports Cloud services like Github, netlify, openai,antropic, etc as well as k8. As said StackQL is a standalone application written in Go 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). Stanadlone binaries are available for Windows, MacOS and Linux, Docker is there too, but since it is open source and free you can grab the code from its Github repo and build it from source. To sum up, StackQL looks to revolutionize the way you work with the Cloud by providing a post modern way of querying, deploying and managing Cloud resources. More Information
Related ArticlesSteampipe - SQL For Everything
To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info |
|||
Last Updated ( Wednesday, 12 March 2025 ) |