Skip to content

Commit

Permalink
feat: add docs for sqlite package
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmcgee committed Oct 1, 2024
1 parent 31e10db commit 59c65c9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,28 @@ A parser and regexes for Nix Store Paths.

A Nix Store path reference scanner.

## `pkg/sqlite`

A collection of interfaces and utilities for writing to and querying various `sqlite` databases that Nix uses.

[sqlc]: https://github.com/sqlc-dev/sqlc

## `pkg/sqlite/binary_cache_v6`

[SQLC] generated code for querying the Nar Info Disk Cache, typically located at `$XDG_CACHE_HOME/nix/binary-cache-v6.sqlite`.

## `pkg/sqlite/eval_cache_v5`

[SQLC] generated code for querying an instance of the Eval Cache, typically located at `$XDG_CACHE_HOME/nix/eval-cache-v5/*.sqlite`.

## `pkg/sqlite/fetcher_cache_v2`

[SQLC] generated code for querying the fetcher cache, typically located in `$XDG_CACHE_HOME/nix/fetcher-cache-v2.sqlite`.

## `pkg/sqlite/nix_v10`

[SQLC] generated code for querying the main Nix database, typically located in `/nix/var/nix/db.sqlite`.

## `pkg/wire`

Methods to parse and produce fields used in the low-level Nix wire protocol.
11 changes: 11 additions & 0 deletions pkg/sqlite/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Sqlite Packages

Each subpackage targets a specific version of an internal Nix [sqlite] database.

The user should only edit `schema.sql` and `query.sql`. All other files are generated by [sqlc] via `sqlc generate` from
the root of the repository.

> Note: when adding a new package, you must edit the `sqlc.yml` file at the root of the repository.
[sqlite]: https://www.sqlite.org/
[sqlc]: https://github.com/sqlc-dev/sqlc

0 comments on commit 59c65c9

Please sign in to comment.