-
Notifications
You must be signed in to change notification settings - Fork 13
Package Database
This document was generated from 'src/documentation/wiki-package-database.ts' on 2026-07-06, 13:41:06 UTC presenting an overview of flowR's bundled CRAN package database that resolves library() calls (v2.11.0, using R v4.6.0). Please do not edit this file/wiki page directly.
flowR ships a database of CRAN package exports so it can resolve calls into the packages you load.
After library(ggplot2), a call to ggplot() resolves to ggplot2::ggplot. This also backs
qualified names (a bare map() after library(purrr) is purrr::map, not the maps plot), the
dependencies and call-context queries, and the undefined-symbol rule.
The exports come from versions:pkgdb, which reads the bundled database (on by default;
see configuring flowR).
Which version's exports are resolved is decided by the version-reading plugins that pin the packages used in a project. These are only examples - more may be registered:
-
versions:descriptionreads a package'sDESCRIPTION(Depends/Imports, src/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.ts). -
versions:renvandversions:rvread a project'srenv.lock/rv.lockto pin exact versions (src/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.ts).
So library(pkg) resolves the pinned version's exports. To override or extend the bundle, hand
versions:pkgdb extra sources (file paths, parsed objects, or http(s) URLs).
function usePackageDatabase(parser: KnownParser) {
const pkgdb = new FlowrAnalyzerPackageVersionsPkgDbPlugin('/path/to/pkgdb-all.json.br');
return new FlowrAnalyzerBuilder().setParser(parser).registerPlugins(pkgdb).build();
}Defined at src/documentation/wiki-package-database.ts#L10
File sources load lazily on the first package load, so scripts without library()/use() calls never
pay for parsing them (set solver.pkgdb.eagerlyLoad to mount the database up front, or solver.pkgdb.enabled: false to switch it off entirely).
For a URL source call preload (await pkgdb.preload()) before analysis to download it.
One JSON object (flowr-pkgdb, schema 4) with a pooled string table.
Reader and writer both live in src/project/plugins/package-version-plugins/pkgdb.ts.
Currently maintained by Florian Sihler and Oliver Gerstl at Ulm University
Email | GitHub | Penguins | Portfolio
- 🧑💻 Developer Onboarding
- 💻 Setup
- 👓 Overview
- 🪟 Interfacing with flowR
- 🌋 Core
- 🧹 Testing & Linting (Benchmark Page)
⁉️ FAQ- ℹ️ Extra Information