mdbtools; unenv; uptasticsearch
The Bonus Drop slipped due to 47 Watch and the Friday embarrassment of all decent U.S. citizens. It also means there’s no “theme” today, which also lets me sneak in an R package (there are so many R blogs out there, so I try to avoid talking about R in the Drops).
TL;DR
(This is an AI-generated summary of today’s Drop using Ollama + llama 3.2 and a custom prompt.)
- MDB Tools is a comprehensive suite for accessing Microsoft Access databases on Unix-like systems, offering components like libmdb, libmdbsql, and various command-line utilities for database management and data extraction (https://github.com/mdbtools/mdbtools)
- unenv is a tool that transforms JavaScript code to run consistently across different environments by providing polyfills, replacements for Node.js modules, and an auto-mocking proxy for unimplemented internals (https://github.com/unjs/unenv)
- uptasticsearch is an R package that simplifies extracting data from Elasticsearch and converting it to tabular format, with functions like es_search() and support for various aggregation types (https://github.com/uptake/uptasticsearch)
mdbtools

This weekend, there was some banter on Bluesky around the NTSB database being offline for a bit. There were some other sites (surrounding NIH) that were also having issues. I created a temporary JSON snapshot of pre- and post-1982 databases, and will be setting up a daily backup of the post-1982 ones, shortly.
These are Microsoft Access databases (yes, that is not a typo). Which means I had to use MDB Tools to make the JSON, so I figured I’d briefly mention the toolkit today.
MDB Tools is a very comprehensive suite designed to access and extract data from Microsoft Access database files (.mdb and .accdb) on Unix-like operating systems. This is a welcome bridge between this ancient format and modern data environments/workflows. The framework is built upon several foundational components:
libmdb: The fundamental library providing direct programmatic access to MDB file structureslibmdbsql: An extension oflibmdbthat implements the Jet SQL engine functionality- ODBC Driver: Enables integration with PHP applications and other ODBC-compatible systems
MDB Tools includes specialized command-line utilities for database management:
mdb-ver: Identifies the Jet engine version (3 or 4) of a given database filemdb-schema: Generates database schema definitions as DDL statementsmdb-export: Converts tables to CSV or SQL formats for migrationmdb-json: Transforms table data into JSON formatmdb-tables: Outputs table names for integration with shell scriptsmdb-count: Provides record counts for tablesmdb-sql: Offers a lightweight SQL query interfacemdb-queries: Retrieves and displays stored queries from the database
Additionally, the gmdb2 component provides a GTK+3-based graphical interface for database viewing and debugging operations.
It was super handy and dead simple to use.
Also, if you poke around the internets, you can find Docker-ized versions of the toolkit (I haven’t tried any of them, so am hesitant to provide a direct link to any of them).
unenv

unenv is a tool designed to address a common challenge in JavaScript development: creating code that runs consistently across different runtime environments. This utility, developed by the unjs team, transforms JavaScript code into a platform-agnostic form, enabling it to function in browsers, workers, Node.js, and other JavaScript runtimes without significant modifications.
It works by providing polyfills and replacements for Node.js built-in modules. This approach lets code originally written for Node.js work in environments like browsers or — perhaps more commonly these days — edge workers. Additionally, unenv offers replacements for common NPM packages, extending cross-platform compatibility to a wider range of JavaScript code.
Another component which lets unenv work its magic is an “auto-mocking” proxy which mocks unimplemented internals, allowing code execution even when certain platform-specific features are unavailable. This capability is handy when dealing with environment-specific APIs or functionalities that may not be present in all target platforms.
unenv helps reduce development time, improves code consistency, and makes your project far more portable. By abstracting away environment-specific details, frees us up to solve problems and add features, rather than grappling with the intricacies of platform-specific implementations.
Even if you only tinker with JS, it’s worth giving unenv a peek.
uptasticsearch

NOTE: This is for R folks…
In our revamped sensor fleet data platform at $WORK I’m stuck in Elasticsearch land. Normally, I pick from a handful of curl/Bash Elasticsarch snippets I have in Joplin, modify them, run the script and use DuckDB to convert the output to something more useful than the gosh awful format Elasticsearch gives me (whomever made that is a monster of a human).
Lately, I’ve been tinkering with {uptasticsearch} (GH). The package is designed to simplify the process of extracting data from Elasticsearch and converting it into a tabular format.
The package’s primary function is es_search(), which returns a data.table containing the parsed results of any given Elasticsearch query, including aggregation queries. But, it has some helpers:
chomp_aggs: “Aggs” query to data.tablechomp_hits: “Hits” to data.tablesget_fields: Get the names and data types of the indexed fields in an indexparse_date_time: Parse date-times from Elasticsearch records (DON’T EVEN GET ME STARTED)unpack_nested_data: Unpack a nested data.table
It groks all the ugly return values including:
- cardinality
- date histogram
- extended stats
- histogram
- percentiles
- significant terms
- stats
- terms
and even supports nested aggregations, allowing for complex data summarization.
I won’t be using this in my systemd timer jobs (DuckDB is way easier to deploy, and both Bash and curl come along for the ride in most environments), but this is a super handy package when I need to poke at some badness happening on the internet “right now”.
FIN
Remember, you can follow and interact with the full text of The Daily Drop’s free posts on:
- 🐘 Mastodon via
@dailydrop.hrbrmstr.dev@dailydrop.hrbrmstr.dev - 🦋 Bluesky via
https://bsky.app/profile/dailydrop.hrbrmstr.dev.web.brid.gy
Also, refer to:
to see how to access a regularly updated database of all the Drops with extracted links, and full-text search capability. ☮️
Leave a comment