18 Commits

Author SHA1 Message Date
Jacob Hinkle
3a2c15aaf4 Add test for record with show-hashes 2022-10-12 10:21:09 -04:00
Jacob Hinkle
c3dd418c8c Fix record command funky timekeeping 2022-10-11 13:43:43 -04:00
Jacob Hinkle
8e69ca3390 Many changes to keys and move persist() to fs.py
This fixes a lot of awkwardness that came from having the record()
functionality inside of store.py. It is still broken, but is much closer
to actually working now. I also sketched some data and io functionality,
which has no tests and is not yet working at all.
2022-10-11 12:27:40 -04:00
Jacob Hinkle
07ccef601c Change to using UUID and SHA256 as DB keys
This is important for distributed settings, and will make merging
databases much simpler. This change is pretty extensive and includes a
lot of other stuff like moving some fields between tables, and
introducing the `local_metadata` table which is a key-value store and
holds the uuid of the "local" store, i.e. the one corresponding to the
directory holding that particular nancy.db.
2022-10-10 15:14:47 -04:00
Jacob Hinkle
c4648ec042 Add tox with mypy, fix typehints. Upgrade black pre-commit hook 2022-10-04 20:56:38 -04:00
Jacob Hinkle
b72051ff75 Run "black" on all python code 2022-09-28 12:21:49 -04:00
45c2046fd6 Update schema putting more into filedir_version 2022-09-27 11:26:05 -04:00
bf141afa5f Add UUID to store table. 2022-09-23 08:41:20 -04:00
fb6a54c6ef Clean up schema and add filedir_versions table 2022-09-22 15:47:49 -04:00
9d48d4d227 Enable contraint parent.filetype='DIR' in filedir 2022-09-22 10:08:30 -04:00
8d6395ecd1 Rename store_file table to filedir 2022-09-22 10:03:44 -04:00
a5cbce3c66 Rename do_record as record in order to facilitate re-use 2022-09-22 09:58:33 -04:00
f55d110e49 Programs are now recorded in the store.
The record() program and cli is not yet working. For that we need a
working `FSDiff` next.  Then we'll finally be ready to start recording
file information.
2022-09-21 21:23:20 -04:00
f18368f1e0 Add Program, Environment, User, Machine, with auto insertion
Also removed freeze and thaw, and converted to record().
2022-09-21 20:51:57 -04:00
d0f113645b Create schema submodule holding versioned schemas
This is meant to hold schemas and migrations. It contains an
`__init__.py` due to a limitation of `importlib.resources` outlined in
detail here: https://github.com/python/importlib_resources/issues/58

Eventually the schema submodule will handle automatic migration of older
databases when importing into new stores.
2022-09-21 13:50:46 -04:00
e75af52765 Create {machine,fs}.py, file scanning, and updated tests
This also fixes the pytest fixture setup (I think).
2022-09-21 13:37:05 -04:00
311990d5f6 Update schema and add tests which don't rely on python 2022-09-20 12:07:32 -04:00
10f5fac0e7 Add schema_version on python side, with match test 2022-09-18 19:43:05 -04:00