Skip to content

Package Database

github-actions[bot] edited this page Jul 6, 2026 · 1 revision

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.

Package Database

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.

Configuration

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:

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.

Format

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.

Clone this wiki locally