Release Notes¶
1.4.2¶
Changed¶
- Add integration with the newly
databasez
0.8.5+. - Internal refactor of the registry.
Fixed¶
- CI integration.
1.4.1¶
Added¶
- Support for
list
andtuples
as a type for model_apps.
1.4.0¶
Added¶
- Support for
model_apps
inside theMigrate
object allowing global discovery by application. This will make sure all apps will be properly inspected. - Add documentation about the new model_apps.
Changed¶
- Upgrade internal requirements.
1.3.7¶
Changed¶
- New lazy loading settings system making it more unique and dynamic working side by side
with
dymmond-settings
.
1.3.6¶
Changed¶
- Update internal
dymmond-settings
minimum requirement.
1.3.5¶
Changed¶
BREAKING CHANGE
Due to some internal compatibilities, Saffier is rolling back to SAFFIER_SETTINGS_MODULE
from SETTINGS_MODULE
SETTINGS_MODULE
was renamed toSAFFIER_SETTINGS_MODULE
.
1.3.4¶
Changed¶
- Update internal anyio dependency.
1.3.3¶
Changed¶
- Upgrade internal requirements.
Fixed¶
auto_now
andauto_now_add
onsave()
andupdate()
wasn't only updating the field withauto_now
.- Extraction of the default field for
date
anddatetime
.
1.3.2¶
Fixed¶
1.3.1¶
Fixed¶
- Fix default for
SAFFIER_SETTINGS_MODULE
if nothing is provided.
1.3.0¶
Added¶
- Added new experimental activate_schema for tenant models using the
using
queryset operator. - Support for ManyToMany to accept strings to the
to
attribute. - Support for new queryset operations only() and defer.
- Intenal
ModelProxy
allowing to manipulate objects querysets such asonly
anddefer
. - Support for secrets and secret queryset.
Changed¶
- Increased maximum of 63 characters the name of the index/unique.
- ModelRow now contains private methods.
- Updated documentation with missing select_related.
- Updated documentation for access of data via foreign keys.
- Deprecating internal settings from Pydantic in favour of Dymmond Settings.
Breaking changes¶
Saffier now uses Dymmond Settings which this simlpy affects the way the settings module is loaded. Prior to version 1.3.0 it was like this:
SAFFIER_SETTINGS_MODULE=...
From version 1.3.0 is:
SAFFIER_SETTINGS_MODULE=...
The rest remains as it. More information about how to use it in the official documentation.
Fixed¶
- Multiple join tables were not generating the complete join statement when using
select_related
. - Fixed metaclass for TenantMixin making sure all the queries are correctly pointing to the right tenant.
- When generating a many to many through model, the maximum length is enforced to be 63 characters.
- Object discovery for intellisense.
- Allow
ManyToMany
to also accept a string as a parameter for theto
.
1.2.0¶
Added¶
- Support for
sync
queries. This will enable Edgy to run in blocking frameworks like Flask, bottle or any other by using the newly added run_sync.
Fixed¶
- Fixed multi tenancy from contrib.
- Fixed
using
where schema name was raising a not found reference for foreign key when querying the tenant.
1.1.0¶
Added¶
- Support for
or_
,and_
andnot_
for SQLAlchemy style queries and Edgy syntax sugar queries.
Changed¶
inspectdb
is now handled by an independent isolated calledInspectDB
.- Updated internal support for
databasez
0.7.0 and this fixes the URL parsing errors for complex passwords caused by theurlsplit
.
Fixed¶
server_default
does not raise aValueError
.server_default
added as validation for nullable.
Warning
This could impact your migrations, so the advise would be to generate a new migration after upgrading to the new version of Edgy to make sure the database reflects the proper nullables/non-nullable fields.
1.0.2¶
Added¶
inspectdb
allowing to generatesaffier.ReflectModel
from the database.
Changed¶
- Added
name
foredgy.UniqueConstraint
allowing unique custom names for theunique_together
. max_name_length
in the datastuctures changed to__max_name_length__
andClassVar
.
1.0.1¶
Changed¶
- Add API Reference.
- Update base requirements.
Fixed¶
Database
object docstring.
1.0.0¶
Added¶
- Support for Python 3.12
Changed¶
- Update base requirements.
0.18.0¶
Added¶
- New Prefetch support allowing to simultaneously load nested data onto models.
- New Signal support allowing to "listen" to model events upon actions being triggered.
Changed¶
- Updated pydantic and alembic
0.17.1¶
Fixed¶
- DeclarativeModel generating internal mappings names was breaking for class objects.
0.17.0¶
Added¶
- Multi tenancy support by updating the registry and allowing to create the multi schema.
- Add new
using(schema=...)
andusing_with_db(database=..., schema=...)
to querysets. - Add support for
create_schema
anddrop_schema
via registry. - Add support to
get_default_schema
from theregistry.schema
. - Documentation for tenancy.
- Improved the documentation for schemas.
- Added a new parameter
extra
to registry allowing to pass a Dict like object containing more database connections. This is an alternative to the registries. - Improved documentation for registry explaining how to use the extra parameters. and query them.
- Added a new ConnectionConfig TypedDict for the registry extra.
Changed¶
- Update the
build
forModel
andReflectModel
to allow passing the schema.
Fixed¶
- Registry
metaclass
wasn't reflecting 100% the schema being passed into the metadata and therefore, querying the database public schema.
0.16.0¶
Changed¶
- Updated versions of the requirements to the latest.
- Internal file structure
- Breaking change. Before for fields the import was
from saffier.db.models.fields import ...
and that was now changed tofrom saffier.db.fields import ...
Added¶
values()
andvalues_list()
to the queryset.
Fixed¶
- ConfigDict in settings.
0.15.0¶
Added¶
- SaffierExtra class allowing the use of Saffier tools without depending on the
Migrate
object.
0.14.2¶
Fixed¶
- AsyncIO event loop blocking the reflection.
0.14.1¶
Fixed¶
- Remove super init from
Registry
.
0.14.0¶
Changed¶
- Update Saffier core to start using Pydantic 2.0 and improved performance.
Note
This is a massive performance improvement done by Pydantic that is now compiled in Rust. This bring a whole new level of performance to Saffier as well.
Warning
To use this version of Saffier with Esmerald, until it is announced compatibility with pydantic 2.0 with Esmerald, it is recommended to use saffier prior to this release.
0.13.0¶
Changed¶
Before
from saffier import fields
Now
from saffier.db import fields
Added¶
- Added
server_default
option for fields allowing to specify if the value should be generated from the DB and how to. - Added support for
save()
of the model. PR #62 by @tarsil
0.12.0¶
Added¶
- New version of the
declarative()
. PR #60 by @tarsil. ManyToMany
andOneToOne
added as alternatives toManyToManyField
andOneToOneField
. The latter will always exist but you can also import theManyToMany
andOneToOne
as alternative instead.
Fixed¶
- Registry now allowing the
lru_caching
to happen properly.
0.11.0¶
Added¶
declarative()
to the models, allowing generating model types of SQLAlchemy declarative base. PR #58 by @tarsil.
0.10.2¶
Added¶
0.10.1¶
Changed¶
0.10.0¶
Changed¶
- Updated to the latest version of pydantic making sure all the fixes are in place.
0.9.0¶
Added¶
- Add protocols to Queryset.
- Add Protocols to Related names
- Support for the new ManyToManyField
- Documentation for ManyToManyField
0.8.0¶
Changed¶
- Updated relationships document with more examples regarding multiple foreign key declarations.
Added¶
contains
method to queryset allowing to query if a given model or reflected model exists in the queryset.related_name
is now supported onForeignKey
allowing transverse queries.- Allow reverse queries using nested fields.
on_update
for ForeignKey and OneToOne fields- Multiple ForeignKeys to the same table is now possible.
- Related Name document added
- Nested queries using related_name
0.7.4¶
Fixed¶
- Removed
nested_asyncio
causing infinite loops.
0.7.3¶
Added¶
postgresql
Typo in requirement installation.
0.7.2¶
Added¶
db_schema
- Added Registry objects of the metadata.
0.7.1¶
Fixed¶
Lifespan
event on shell returning async manager.
0.7.0¶
Changed¶
- Renamed
saffier-admin
tosaffier
. - Deprecate
saffier-admin
. Now you can simply callsaffier
with the same commands as before.
Added¶
- New
shell
command that allows interactive shell with saffier models. - New
SAFFIER_SETTINGS_MODULE
allowing to create and pass specific and unique settings to any saffier instance. - Added support for
ipython
andptpython
for shell access viasaffier
.
Fixed¶
- Linting and formatting issues with Ruff.
- Bug with ReflectModel. A ReflectModel might not need all the fields from the database and the mapping should reflect that.
run_until_complete
issues fixed withnest_asyncio
.
0.6.1¶
Fixed¶
UUIField
generations with Alembic.
0.6.0¶
Added¶
- Support for SQLAlchemy 2.
Changed¶
- Moved from
databases
to its forkdatabasez
and updated internal references. DatabaseClient
is now being directly used from Databasez test client.
Fixed¶
- Updated requirements.
0.5.0¶
Changed¶
- Updated requirements to support Esmerald >= 1.1.0 for testing.
- Updated testing and docs requirements.
Added¶
- Metaclass option to support database tables reflection. Allowing reading tables from existing database. 35
- Documentation regarding the reflection of tables. #37
Fixed¶
- Typos in documentation
0.4.0¶
Changed¶
Added¶
0.3.0¶
Added¶
-
Integrated the support for native migrations with Saffier.
- This brings native generated migrations within Saffier under Alembic's package, allowing a seemless integration and cross-compatibility with any framework using Saffier.
-
Added new DatabaseTestClient delegating the creating of the
test
database for each connection string provided.- No more needed to manually create two separate databases thanks to the client that does the automatic management for you.
0.2.1¶
Changed¶
- This was supposed to go in the release 0.2.0 and it was missed. Updated queryset lookup for functions allowing accesing the model functions from the manager directly.
0.2.0¶
Added¶
- New Index object allowing the creation of internal SQLAlchemy indexes.
Changed¶
- Updated metaclass to validate the fields being added to
indexes
.
0.1.0¶
This is the initial release of Saffier.
- Model inheritance - For those cases where you don't want to repeat yourself while maintaining intregity of the models.
- Abstract classes - That's right! Sometimes you simply want a model that holds common fields that doesn't need to created as a table in the database.
- Meta classes - If you are familiar with Django, this is not new to you and Saffier offers this in the same fashion.
- Managers - Versatility at its core, you can have separate managers for your models to optimise specific queries and querysets at ease.
- Filters - Filter by any field you want and need.
- Model operators - Classic operations such as
update
,get
,get_or_none
,bulk_create
,bulk_update
and a lot more. - Relationships made it easy - Support for
OneToOne
andForeignKey
in the same Django style. - Constraints - Unique constraints through meta fields.