Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
Changelog
=========

[Unreleased]
------------

Added
^^^^^
- :class:`~scim2_sqlalchemy.Entry` stores a multi-valued attribute holding one entry at most, such
as a work email, in columns of the resource record.
- ``meta.created`` and ``meta.lastModified`` are optional: without them, the resources have no such
date.
- The ``version`` of a :class:`~scim2_sqlalchemy.ResourceMapping` is optional. Without it,
``meta.version`` is a hash of the resource, keyed with the new ``version_key`` of the storages.

Changed
^^^^^^^
- Needs scim2-server 0.9.0 or later.
- The storages are built on the mapping core of scim2-server, :mod:`scim2_server.mapping`, which
scim2-django shares. Some error and warning messages of the mappings change.
- :meth:`~scim2_sqlalchemy.ResourceMapping.schemas` publishes an attribute that is never returned
with the mutability of its schema, rather than ``writeOnly``. A hidden sub-attribute of an
immutable attribute keeps its own mutability.
- A :class:`~scim2_sqlalchemy.Link` refuses a relationship to another class than the record of
the mapping it links to.

[0.3.0] - 2026-11-26
--------------------

Expand Down
9 changes: 5 additions & 4 deletions doc/how-to/map-a-data-model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ Prepare the SQLAlchemy model

Give each SQLAlchemy model the columns the storage needs:

- a primary key, mapped to ``id``;
- a primary key, mapped to ``id``. A :class:`~scim2_sqlalchemy.ResourceMapping` without it
raises a :class:`ValueError`;
- a creation date and a modification date, mapped to ``meta.created`` and
``meta.lastModified``;
``meta.lastModified``. Without them, the resources have no such date;
- an integer :ref:`version counter <sqlalchemy:mapper_version_counter>`, declared as the
``version_id_col`` of the mapper, and passed as the ``version`` of the mapping.
``version_id_col`` of the mapper, and passed as the ``version`` of the mapping. Without it,
``meta.version`` is a hash of the resource, keyed with the ``version_key`` of the storage.

A :class:`~scim2_sqlalchemy.ResourceMapping` without one of them raises a :class:`ValueError`.
The project model of the intranet has these columns:

.. literalinclude:: ../_examples/intranet/projects.py
Expand Down
2 changes: 2 additions & 0 deletions doc/reference/mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ generating them from the resource types.

.. autoclass:: scim2_sqlalchemy.Many

.. autoclass:: scim2_sqlalchemy.Entry

.. autoclass:: scim2_sqlalchemy.Link

.. autofunction:: scim2_sqlalchemy.generate_mappings
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ authors = [
requires-python = ">=3.11"
dependencies = [
"scim2-models>=0.12.7",
"scim2-server>=0.8.9",
"scim2-server>=0.9.0",
"sqlalchemy>=2.0.41",
]

Expand All @@ -54,7 +54,7 @@ dev = [
"pytest-cov>=7.1.0",
"pytest-postgresql>=9.1.0",
"scim2-client>=0.14.0",
"scim2-server[testing]>=0.8.9",
"scim2-server[testing]>=0.9.0",
"scim2-tester[testing]>=0.6.2",
"tox-uv>=1.36.0",
"werkzeug>=3.1.8",
Expand Down
2 changes: 2 additions & 0 deletions src/scim2_sqlalchemy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .generation import generate_mappings
from .mapping import Attribute
from .mapping import Entry
from .mapping import Hashed
from .mapping import Link
from .mapping import Many
Expand All @@ -10,6 +11,7 @@
__all__ = [
"AsyncSqlAlchemyStorage",
"Attribute",
"Entry",
"Hashed",
"Many",
"Link",
Expand Down
Loading