Skip to content

SirStoke/airquery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Airquery

Run SQL queries directly on Airtable bases, without copying data into an RDBMS first!

Install

Using docker

You can use stoke/airquery:

docker run --rm stoke/airquery

Using nix

This repository includes a flake, just run:

nix run github:SirStoke/airquery

How to use

Requirements:

Then, you can run airquery like so:

airquery -k <PERSONAL_ACCESS_TOKEN> -b <BASE_ID> <query>

The underlying base can be accessed under airtable.airtable.<lowercase-base-name>. E.g.

airquery -k <PERSONAL_ACCESS_TOKEN> -b <BASE_ID> 'SELECT * FROM airtable.airtable.transactions'

For more advanced usage, just follow airquery --help (cargo run -- --help from the source).

SQL support

Under the hood, airquery uses datafusion as its SQL engine. You can check out their SQL Reference to know which features are supported.

TODO

Data types

  • Support basic airtable types

    • singleLineText / singleSelect / phoneNumber / email
    • currency / number / percent
    • date
    • dateTime
    • checkbox (treated as number, either 0 or 1. No support for native booleans in datafusion)
  • Support advanced airtable types

    • duration
    • formula
    • lookup
    • multiple select
    • long text / rich text

Features

  • SQL engine

    • Basic SQL support
    • Filters pushdown
    • Sorting pushdown
  • Basic CLI

    • JSON output
    • Prettified tables
  • WASM support