Commit Graph

113 Commits

Author SHA1 Message Date
Yurii Motov
6176f56f1f Merge remote-tracking branch 'upstream/main' into discriminator-type-hints 2026-02-20 22:38:53 +01:00
Sebastián Ramírez
3e123f71cb 🔖 Release version 0.0.35 2026-02-20 17:41:02 +01:00
Sebastián Ramírez
ede8dd062d Drop support for Python 3.9 (#1766) 2026-02-20 17:34:55 +01:00
Sebastián Ramírez
3366c91dbe 🔖 Release version 0.0.34 2026-02-16 20:05:20 +01:00
Sebastián Ramírez
32e204e0cb 🔖 Release version 0.0.33 2026-02-11 16:22:38 +01:00
Varun Chawla
2dec44bfd8 ✏️ Fix typos in inline comment in expression.py (#1747)
Fix typos in expression.py comment

Fixed two typos in the comment on line 47:
- "operatos" -> "operators"
- "expresion" -> "expression"

The comment now correctly reads: "Redefine operators that would only take a column expression..."
2026-02-09 08:07:12 +01:00
Daniel Sam
edcaa54927 📝 Fix async example in session.execute() docstring & deprecation message (#1643)
Fix async example in session.execute() deprecation warning & docstring

Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
2026-02-06 10:15:02 +01:00
Motov Yurii
60181e61fc 👷 Run mypy by pre-commit (#1738)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-03 19:11:03 +01:00
Sebastián Ramírez
dd51746fff 🔖 Release version 0.0.32 2026-02-01 19:17:25 +01:00
Victor Mota
66533c96d9 🐛 Fix support for Annotated fields with Pydantic 2.12+ (#1607)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
Co-authored-by: svlandeg <svlandeg@github.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2026-02-01 19:14:55 +01:00
Yurii Motov
80f89862ae Allow Discriminator for discriminator in Field 2026-01-29 10:32:43 +01:00
Sofie Van Landeghem
99d8b0bba2 ♻️ Import Literal from the typing module directly (#1699)
import Literal from typing now that Python 3.8 is dropped
2026-01-13 12:30:07 +01:00
Sebastián Ramírez
2cc11dada3 🔖 Release version 0.0.31 2025-12-28 13:33:38 +01:00
Sebastián Ramírez
5917b192f2 Drop support for Pydantic v1 (#1701)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-12-28 13:32:26 +01:00
Sebastián Ramírez
9c13e0012b 🔖 Release version 0.0.30 2025-12-26 12:43:53 +01:00
Sebastián Ramírez
056232ab45 Drop support for Python 3.8 (#1696) 2025-12-26 12:23:00 +01:00
Sebastián Ramírez
c702e2ec3e 🔖 Release version 0.0.29 2025-12-23 21:58:42 +01:00
Ravishankar Sivasubramaniam
5b1d8e6e7d 🐛 Fix alias support for Pydantic v2 (#1577)
Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2025-12-23 20:57:43 +00:00
Sebastián Ramírez
59adbe76a6 🔖 Release version 0.0.28 2025-12-23 17:39:28 +01:00
Bart Schuurmans
6cec19c8dc 🐛 Fix RuntimeError: dictionary changed size during iteration in sqlmodel_update() (#997)
Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
2025-12-23 17:23:54 +01:00
Sofie Van Landeghem
95c6b2d673 Remove unused type ignores since SQLAlchemy 2.0.44 (#1613) 2025-10-21 11:29:39 +02:00
Sebastián Ramírez
a85de910d1 🔖 Release version 0.0.27 2025-10-08 18:37:37 +02:00
Sofie Van Landeghem
45215fceca ⬆️ Add support for Python 3.14 (#1578)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-08 18:26:33 +02:00
Sebastián Ramírez
0cbf2e6049 🔖 Release version 0.0.26 2025-10-08 13:17:26 +02:00
dependabot[bot]
f751e1c797 ⬆ Bump mypy from 1.4.1 to 1.18.2 (#1560)
* ⬆ Bump mypy from 1.4.1 to 1.18.1

Bumps [mypy](https://github.com/python/mypy) from 1.4.1 to 1.18.1.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.4.1...v1.18.1)

---
updated-dependencies:
- dependency-name: mypy
  dependency-version: 1.18.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* restrict to latest version that supports python 3.8

* remove unnecssary ignore statement

* add ignore statement

* make ignore statement more specific

* expand on mypy command to debug CI failure

* experiment with from future import

* use the latest mypy for Python 3.9 and up

* fix type of keys to be removed

* annotate origin as Any to avoid type issues

* bump to 1.10.0 only for now

* exclude one particular file from mypy processing

* Try to bump to 1.18.2 again

* attempt to remove the future import again

* add back future import

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
Co-authored-by: svlandeg <svlandeg@github.com>
2025-10-08 13:10:30 +02:00
Andrew Grangaard
0402496be2 🐛 Fix attribute handling in model_dump for compatibility with the latest Pydantic versions (#1595) 2025-10-08 12:33:47 +02:00
Sebastián Ramírez
192ba90b1e 🔖 Release version 0.0.25 2025-09-17 23:39:08 +02:00
seria
037c051997 Add overload for exec method to support insert, update, delete statements (#1342)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
2025-09-17 23:37:02 +02:00
Sofie Van Landeghem
4b5ad42c23 💚 Fix linting in CI (#1340)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2025-04-26 21:04:09 +02:00
Sebastián Ramírez
de78b8c7bc 🔖 Release version 0.0.24 2025-03-07 06:40:27 +01:00
dependabot[bot]
1e853aaf6d ⬆ Bump ruff from 0.6.2 to 0.9.6 (#1294)
* ⬆ Bump ruff from 0.6.2 to 0.9.6

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.6.2 to 0.9.6.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.6.2...0.9.6)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* format with ruff 0.9.6

* 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks

* also bump in pre-commit config

* 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
Co-authored-by: svlandeg <sofie.vanlandeghem@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-03-07 04:21:45 +01:00
Sofie Van Landeghem
b1349dae45 ⬆️ Add support for Python 3.13 (#1289) 2025-03-06 19:58:40 +01:00
Sebastián Ramírez
bf376f83ca 🔖 Release version 0.0.23 2025-02-28 17:54:40 +01:00
Alan Bogarin
7a51870361 🐛 Fix type annotation in Field constructor (#1304)
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
2025-02-28 15:04:27 +01:00
Andrey Siunov
69a4504a33 🐛 Fix Pydantic version check for version 2.10.x onwards (#1255)
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
2025-02-28 15:01:13 +01:00
Sebastián Ramírez
aa814e24bc 🚨 Fix types for new Pydantic (#1131) 2024-10-07 21:21:59 +00:00
Sebastián Ramírez
016b2baaad 🔖 Release version 0.0.22 2024-08-31 11:40:12 +02:00
Sebastián Ramírez
a14ab0bd3c 🐛 Fix support for types with Optional[Annoated[x, f()]], e.g. id: Optional[pydantic.UUID4] (#1093) 2024-08-31 11:38:19 +02:00
Sebastián Ramírez
458e088170 🔖 Release version 0.0.21 2024-07-20 21:10:30 -05:00
Esteban Maya
86ab09f7ec Add support for cascade delete relationships: cascade_delete, ondelete, and passive_deletes (#983)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-07-20 21:08:06 -05:00
Sebastián Ramírez
b8d7f4ff67 🔖 Release version 0.0.20 2024-07-16 21:53:24 -05:00
Esteban Maya
95936bb508 Add official UUID support, docs and tests, internally using new SQLAlchemy 2.0 types (#992)
*  Add UUID support from sqlalchemy 2.0 update

* ⚰️ Remove dead code for GUID old support

* 📝 Add documentation for UUIDs

* 🧪 Add test for UUIDs field definition and support

* 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks

* ✏️ Fix prerequisites docs for uuid

* ♻️ Update UUID source examples for consistency

Keep consistency with other examples, functions without parameters, and printing info that shows and explains the UUID results (and can also be tested later)

* 📝 Add source examples for selecting UUIDs with session.get()

* 📝 Re-structure UUID docs

* Explain the concepts at the beggining before using them.
* Explain how UUIDs can be used and trusted.
* Explain why UUIDs could be generated on the code, and how they can be used for distributed systems.
* Explain how UUIDs can prevent information leakage.
* Warn about UUIDs storage size.
* Explain that uuid is part of the standard library.
* Explain how default_factory works.
* Explain that creating an instance would generate a new UUID, before it is sent to the DB. This is included and shown in the example, the UUID is printed before saving to the DB.
* Remove sections about other operations that would behave the same as other fields and don't need additional info from what was explained in previous chapters.
* Add two examples to select using UUIDs, similar to the previous ones, mainly to be able to use them in the tests and ensure that it all works, even when SQLite stores the values as strings but the where() or the session.get() receive UUID values (ensure SQLAlchemy does the conversion correctly for SQLite).
* Add an example terminal run of the code, with comments.
* Simplify the ending to keep only the information that wasn't there before, just the "Learn More" with links.

*  Refactor tests with new printed code, extract and check that UUIDs are used in the right places.

*  Add tests for the new extra UUID examples, for session.get()

* 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks

* 📝 Rename variable in example for Python 3.7+ for consistency with 3.10+ (I missed that change before)

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-07-16 20:52:03 -05:00
Anderson T
e7c62fc9d9 ✏️ Fix typo in sqlmodel/_compat.py (#950) 2024-06-04 18:56:52 -05:00
Sebastián Ramírez
4590963e88 🔖 Release version 0.0.19 2024-06-03 22:26:53 -05:00
Sebastián Ramírez
b560e9deb8 ⬆️ Upgrade Ruff and Black (#968)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-06-03 22:22:04 -05:00
Esteban Maya
1d43bd8b1e 🐛 Fix pydantic EmailStr support and max_length in several String subclasses (#966) 2024-06-03 21:47:40 -05:00
Sebastián Ramírez
d165e4b5ad ♻️ Refactor generate select template to isolate templated code to the minimum (#967)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-06-03 21:34:54 -05:00
Esteban Maya
5bb4cffd49 🐛 Fix set varchar limit when max_length is set on Pydantic models using Pydantic v2 (#963)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-06-04 00:39:23 +00:00
Sebastián Ramírez
900e0d3371 🔖 Release version 0.0.18 2024-04-29 23:25:02 -07:00
Sebastián Ramírez
9ebbf255f7 Add sqlmodel-slim setup (#916) 2024-04-30 06:22:28 +00:00