65 Commits

Author SHA1 Message Date
900e0d3371 🔖 Release version 0.0.18 2024-04-29 23:25:02 -07:00
9ebbf255f7 Add sqlmodel-slim setup (#916) 2024-04-30 06:22:28 +00:00
0431c5bb26 🔖 Release version 0.0.17 2024-04-29 16:44:21 -07:00
0b4989d0b2 🔧 Migrate from Poetry to PDM for the internal build config (#912) 2024-04-29 15:58:15 -07:00
2454694de3 ♻️ Refactor types to properly support Pydantic 2.7 (#913) 2024-04-29 15:11:02 -07:00
6b562358fc 🔖 Release version 0.0.16 2024-02-17 14:53:16 +01:00
fa12c5d87b Add new method sqlmodel_update() to update models in place, including an update parameter for extra data (#804) 2024-02-17 14:49:39 +01:00
7fec884864 🔖 Release version 0.0.15 2024-02-17 14:36:12 +01:00
1b7b3aa668 🐛 Fix class initialization compatibility with Pydantic and SQLModel, fixing errors revealed by the latest Pydantic (#807) 2024-02-17 13:34:57 +00:00
8419545a3a 👷 Fix GitHub Actions build docs filter paths for GitHub workflows (#738)
* 👷 Fix GitHub Actions build docs filter paths for GitHub workflows

* 🎨 Update format of expression and conftest
2023-12-10 20:19:12 +00:00
b892504141 🔖 Release version 0.0.14 2023-12-04 15:51:20 +01:00
fa2f178b8a Add support for Pydantic v2 (while keeping support for v1 if v2 is not available), including initial work by AntonDeMeester (#722)
Co-authored-by: Mohamed Farahat <farahats9@yahoo.com>
Co-authored-by: Stefan Borer <stefan.borer@gmail.com>
Co-authored-by: Peter Landry <peter.landry@gmail.com>
Co-authored-by: Anton De Meester <antondemeester+github@gmail.com>
2023-12-04 15:42:39 +01:00
5b733b348d 🔖 Release version 0.0.13 2023-12-04 13:15:10 +01:00
853d787923 ♻️ Refactor type generation of selects re-order to prioritize models to optimize editor support (#718) 2023-12-04 09:46:59 +00:00
4ac87146b1 🔇 Do not raise deprecation warnings for execute as it's automatically used internally (#716)
* 🔇 Do not raise deprecation warnings for execute as it's automatically used internally

*  Tweak tests to not use deprecated query
2023-11-30 15:23:06 +00:00
b1c2f822c9 🔖 Release version 0.0.12 2023-11-18 12:32:59 +01:00
8ed856d322 Upgrade SQLAlchemy to 2.0, including initial work by farahats9 (#700)
Co-authored-by: Mohamed Farahat <farahats9@yahoo.com>
Co-authored-by: Stefan Borer <stefan.borer@gmail.com>
Co-authored-by: Peter Landry <peter.landry@gmail.com>
2023-11-18 12:30:37 +01:00
dacc1fa9ca 🔖 Release version 0.0.11 2023-10-29 13:56:39 +04:00
cbaf172c63 Add support for passing a custom SQLAlchemy type to Field() with sa_type (#505)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-10-29 12:10:39 +04:00
717594ef13 Do not allow invalid combinations of field parameters for columns and relationships, sa_column excludes sa_column_args, primary_key, nullable, etc. (#681)
* ♻️ Make sa_column exclusive, do not allow incompatible arguments, sa_column_args, primary_key, etc

*  Add tests for new errors when incorrectly using sa_column

*  Add tests for sa_column_args and sa_column_kwargs

* ♻️ Do not allow sa_relationship with sa_relationship_args or sa_relationship_kwargs

*  Add tests for relationship errors

*  Fix test for sa_column_args
2023-10-28 17:55:23 +04:00
e4e1385eed 🔖 Release version 0.0.10 2023-10-26 18:34:49 +04:00
99f8ce3894 Add support for all Field parameters from Pydantic 1.9.0 and above, make Pydantic 1.9.0 the minimum required version (#440)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-10-26 14:18:05 +04:00
d05c3ee495 🔖 Release version 0.0.9 2023-10-24 01:01:18 +04:00
9732c5ac60 🐛 Fix AsyncSession type annotations for exec() (#58)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-10-23 18:58:16 +04:00
9809b5bc83 🐛 Fix allowing using a ForeignKey directly, remove repeated column construction from SQLModelMetaclass.__init__ and upgrade minimum SQLAlchemy to >=1.4.36 (#443)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-10-23 17:59:06 +04:00
d3261cab59 🐛 Fix enum type checks ordering in get_sqlalchemy_type (#669)
Co-authored-by: Pierre Cheynier <p.cheynier@criteo.com>
2023-10-23 13:22:44 +04:00
27a81b2112 🎨 Run pre-commit on all files and autoformat (#666) 2023-10-23 11:46:31 +04:00
065fcdc828 👷 Move to Ruff and add pre-commit (#661)
* 👷 Add pre-commit

* 🔧 Add pyproject.toml config for Ruff

*  Replace isort, flake8, autoflake with Ruff

* 🔨 Update lint and format scripts

* 🎨 Format with Ruff

* 🔧 Update Poetry config
2023-10-23 07:34:50 +00:00
840fd08ab2 Raise a more clear error when a type is not valid (#425)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-10-23 10:42:30 +04:00
1568bad01e ✏️ Fix typos found with codespell (#520)
Found via `codespell -S *.svg,*.css,*.js,*.drawio -L pullrequest,sesion`
2023-10-22 16:50:44 +04:00
d5219aa3c5 🐛 Fix SQLAlchemy version 1.4.36 breaks SQLModel relationships (#315) (#461)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-10-22 16:01:51 +04:00
02bd7ebffd 🗑️ Deprecate Python 3.6 and upgrade Poetry and Poetry Version Plugin (#627) 2023-07-29 12:32:47 +02:00
267cd42fb6 ✏️ Fix typo in internal function name get_sqlachemy_type() (#496)
Corrected name is get_sqlalchemy_type().
2022-11-12 07:44:19 +01:00
75ce45588b 🔖 Release version 0.0.8 2022-08-30 19:52:36 +02:00
ae144e0a39 🐛 Fix auto detecting and setting nullable, allowing overrides in field (#423)
Co-authored-by: Benjamin Rapaport <br@getallstreet.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-30 18:18:32 +02:00
b51ebaf658 ♻️ Update expresion.py, sync from Jinja2 template, implement inherit_cache to solve errors like: SAWarning: Class SelectOfScalar will not make use of SQL compilation caching (#422) 2022-08-29 11:44:08 +02:00
f9522b3913 🔖 Release version 0.0.7 2022-08-28 01:59:44 +02:00
6216409f96 ♻ Refactor internal statements to simplify code (#53) 2022-08-28 01:53:02 +02:00
92f52a3fc5 ♻ Refactor internal imports to reduce redundancy (#272)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-27 23:50:12 +00:00
42b0e6eace Allow setting unique in Field() for a column (#83)
Co-authored-by: Raphael Gibson <raphael.araujo@estantemagica.com.br>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-28 01:49:29 +02:00
5429e9b6aa 🐛 Fix type annotations for Model.parse_obj(), and Model.validate() (#321)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-28 01:22:09 +02:00
475578757f 🐛 Fix Select and SelectOfScalar to inherit cache to avoid warning: SAWarning: Class SelectOfScalar will not make use of SQL compilation caching (#234)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-28 01:17:37 +02:00
d380736043 🐛 Fix handling validators for non-default values (#253)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-27 23:10:23 +00:00
680602b7eb 🐛 Fix fields marked as "set" in models (#117)
Co-authored-by: Michael Statt <michael.statt@modelyst.io>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-27 22:59:09 +00:00
eef0b7770b 🐛 Fix Enum handling in SQLAlchemy (#165)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-28 00:48:44 +02:00
5ea9340def Update GUID handling to use stdlib UUID.hex instead of an int (#26)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-28 00:28:09 +02:00
9830ee0d89 🐛 Fix setting nullable property of Fields that don't accept None (#79)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-28 00:18:57 +02:00
dc4dc42ec5 Raise an exception when using a Pydantic field type with no matching SQLAlchemy type (#18)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-27 20:13:32 +00:00
4dd7b890d4 🐛 Fix SQLAlchemy version 1.4.36 breaks SQLModel relationships (#315) (#322)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-27 20:10:38 +02:00
03e861d048 Add new Session.get() parameter execution_options (#302) 2022-04-16 11:13:19 +02:00