Ferris the crab's favorite Airtable library
Find a file
2026-01-11 20:39:21 +00:00
ferrtable improve documentation 2026-01-11 20:39:21 +00:00
ferrtable-test add get_record() 2025-10-19 01:14:29 -07:00
.gitignore initial commit 2025-09-15 00:59:47 -07:00
LICENSE.md add mit license 2025-09-16 23:23:56 -07:00
mise.toml initial commit 2025-09-15 00:59:47 -07:00
README.md move readme 2025-09-16 23:23:56 -07:00

Ferrtable: Ferris the Crab's Favorite Airtable Client

Ferrtable provides async Rust bindings for a subset of the Airtable web API. Notably, it allows records to be read from and written to arbitrary Rust types that implement the Clone, serde::Deserialize, and serde::Serialize traits.

This crate follows in the footsteps of the airtable-api crate from Oxide Computer Company, which appears to have been archived and unmaintained since 2022. By comparison, Ferrtable aims to provide a more flexible and expressive client interface as well as greater control over paginated responses with the help of async streams.

Status: Work in Progress

Only a limited set of operations (e.g., creating and listing records) are currently supported. The goal is to implement coverage for at least the full set of non-enterprise API endpoints, but my initial emphasis is on getting a relatively small subset built and tested well.

Usage

use std::error::Error;

use futures::prelude::*;

// Ferrtable allows us to use any record types that implement Clone,
// Deserialize, and Serialize.
#[derive(Clone, Debug, Deserialize, Serialize)]
struct MyRecord {
    #[serde(rename = "Name")]
    name: String,

    #[serde(rename = "Notes")]
    notes: String,

    #[serde(rename = "Assignee")]
    assignee: Option<String>,

    #[serde(rename = "Status")]
    status: Status,

    #[serde(rename = "Attachments")]
    attachments: Vec<ferrtable::cell_values::AttachmentRead>,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
enum Status {
    Todo,

    #[serde(rename = "In progress")]
    InProgress,

    Done,
}

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    let client = ferrtable::Client::new_from_access_token("******").unwrap();

    client
        .create_records([MyRecord {
            name: "Steal Improbability Drive".to_owned(),
            notes: "Just for fun, no other reason.".to_owned(),
            assignee: None,
            status: Status::InProgress,
            attachments: vec![],
        }])
        .with_base_id("***".to_owned())
        .with_table_id("***".to_owned())
        .build()?
        .execute()
        .await?;

    let mut rec_stream = client
        .list_records()
        .with_base_id("***".to_owned())
        .with_table_id("***".to_owned())
        .with_filter("{status} = 'Todo' || {status} = 'In Progress'".to_owned())
        .build()?
        .stream_items::<MyRecord>();

    while let Some(result) = rec_stream.next().await {
        dbg!(result?.fields);
    }

    Ok(())
}

Crate Release Process

Maintainers: Eventually the release process should be automated, but until CI runners are available for the repo, follow this checklist.

  1. Lint:
cd ferrtable
cargo fmt --check
cargo clippy

cd ../ferrtable-test
cargo fmt --check
cargo clippy
  1. Run integration tests:
cd ferrtable-test
cat <<EOF
access_token = "<AIRTABLE ACCESS TOKEN>"
base_id = "<BASE ID>"
table_id = "<TABLE ID>"
EOF > ferrtable-test.config.toml
cargo run
  1. Run unit tests:
cd ferrtable
# At the time of this writing, nextest doesn't actually have anything to run,
# but it may in the future as tests are added outside of doc comments.
cargo nextest run --all-features --no-tests=warn
cargo test --doc
  1. Bump version in Cargo.toml.
  2. Update main package version in ferrtable-test lockfile:
cd ferrtable-test
cargo build
  1. Commit and push changes.
  2. Publish:
cargo publish