Tech & AI News
Hacker News

Three ways to smuggle SQLite into Nix

The index stores package metadata in two JSON files totaling ~13 MiB for 305 k versions, but Nix’s eager `builtins.fromJSON` parses the entire data for any lookup, causing inefficient queries. Using `builtins.exec` (since Nix 1.11.9) to run SQLite, the author creates Nix attribute sets from SQL queries, providing fast, compact access while requiring the unsafe-native-code option and spawning an external process per query.