This is the first release after migrating from SQLModel/SQLAlchemy to Django.
With this, we're hopeful that we get closer to a production-ready 1.0.0 API.
Highlights:
- More robust & simpler automated migrations: `lamin migrate create` & `lamin migrate deploy`
- Simpler query syntax (no joins anymore): `ln.File.select(transform__created_by=user)`
- No need to create a session object to load relationships: access `file.transform` to load a `Transform` object
- No need to write out link models in schemas & generally simplified schema syntax
- Any schema package (`lnschema_myschema`) is now managed as minimal Django app
Breaking changes:
- Renamed `ln.Features` to `ln.FeatureSet` and is now typically instantiated with `FeatureSet.from_iterable()`
- Removed `ln.Session`
- Removed `.join()` (replaced `SelectStmt` with `QuerySet`)
- `.all()` now returns a `QuerySet` and no longer a list (use `.list()` instead)
- Access `Bionty` objects within `lnschema_bionty` via `Registry.bionty()` instead of `Registry.bionty`
- Removed `File.stream()` as all functionality is now provided through `File.backed()`
- Many-to-many fields are now set with `Run.inputs.set()` and appended with `Run.inputs.add()`
Non-breaking changes:
- Vastly simplified dependencies & introduced configurable installation
- Auto-generated storage keys are now of the form `lndb/{id}.{suffix}` rather than just `{id}.{suffix}`
- Renamed `ln.add()` to `ln.save()`
- Introduced `Registry.select()`, `Registry.save()`, and `Registry.delete()`
- Better tracking & linking of Bionty sources in `lnschema_bionty`
Additional notes:
- Consolidated docs and auto-generate upon push events to lamindb main
- Consolidated submodules (renamed `lndb` to `lamindb-setup`, removed `lndb-storage`)
The main downsides of migrating to Django are:
- Currently only one LaminDB instance loadable per Python session
- Type hints & constructor signatures are less pythonic (SQLModel uses less magic than Django) and lead to idiosyncrasies in model definition (nullable defaults) and validation (validation at the Registry-level is more manual as Django foresees validation at the Form level)
- SQLAlchemy provides the more powerful Registry, and there might be future use cases that will require them
Complete list of changes below.
<!-- prettier-ignore -->
Name | PR | Developer | Date | Version
--- | --- | --- | --- | ---
โป๏ธ Use `TransformType` | [763](https://github.com/laminlabs/lamindb/pull/763) | [falexwolf](https://github.com/falexwolf) | 2023-06-13 |
๐ท Dispatch to lamin-examples & redun-lamin-fasta | [762](https://github.com/laminlabs/lamindb/pull/762) | [falexwolf](https://github.com/falexwolf) | 2023-06-13 |