Commit Graph

538 Commits

Author SHA1 Message Date
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
github-actions 3b889e09f7 📝 Update release notes 2024-06-21 02:17:19 +00:00
Toby Penner 600da0a25c ✏️ Fix internal link in docs/tutorial/create-db-and-table.md (#911) 2024-06-20 21:16:56 -05:00
github-actions 96bfd855f8 📝 Update release notes 2024-06-05 01:52:54 +00:00
Alejandra 8416508d79 ✏️ Add missing step in create-db-and-table-with-db-browser.md (#976) 2024-06-05 01:52:36 +00:00
github-actions f1bfebc9e2 📝 Update release notes 2024-06-05 00:00:30 +00:00
Lucien O 1263024be5 ✏️ Fix typo in docs/tutorial (#943) 2024-06-04 19:00:14 -05:00
github-actions 23869cab0d 📝 Update release notes 2024-06-04 23:58:51 +00:00
Mieszko Bańczerowski 24e76c7a13 ✏️ Fix typo in docs/tutorial/relationship-attributes/index.md (#880) 2024-06-04 18:58:27 -05:00
github-actions 6e7e553963 📝 Update release notes 2024-06-04 23:57:10 +00:00
Anderson T e7c62fc9d9 ✏️ Fix typo in sqlmodel/_compat.py (#950) 2024-06-04 18:56:52 -05:00
github-actions 8703539bf0 📝 Update release notes 2024-06-04 23:48:20 +00:00
Alejandra f6ad19b1a7 ✏️ Update pip installation command in tutorial (#975) 2024-06-04 23:48:02 +00:00
Sebastián Ramírez 4590963e88 🔖 Release version 0.0.19 0.0.19 2024-06-03 22:26:53 -05:00
github-actions 883cbe3a8d 📝 Update release notes 2024-06-04 03:22:28 +00: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
github-actions e2f646dea5 📝 Update release notes 2024-06-04 03:19:04 +00:00
dependabot[bot] b93dd95125 ⬆ Bump tiangolo/issue-manager from 0.4.1 to 0.5.0 (#922)
Bumps [tiangolo/issue-manager](https://github.com/tiangolo/issue-manager) from 0.4.1 to 0.5.0.
- [Release notes](https://github.com/tiangolo/issue-manager/releases)
- [Commits](https://github.com/tiangolo/issue-manager/compare/0.4.1...0.5.0)

---
updated-dependencies:
- dependency-name: tiangolo/issue-manager
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 22:18:48 -05:00
github-actions ceac7bc2e8 📝 Update release notes 2024-06-04 02:48:00 +00:00
Esteban Maya 1d43bd8b1e 🐛 Fix pydantic EmailStr support and max_length in several String subclasses (#966) 2024-06-03 21:47:40 -05:00
github-actions 9f3af8507e 📝 Update release notes 2024-06-04 02:35:16 +00: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
github-actions d5cba6e358 📝 Update release notes 2024-06-04 01:39:25 +00:00
Sebastián Ramírez bd1641c9a2 ⬆️ Update minimum SQLAlchemy version to 2.0.14 as that one includes TryCast used internally (#964) 2024-06-03 20:39:07 -05:00
github-actions 71de44daba 📝 Update release notes 2024-06-04 01:34:41 +00:00
Sebastián Ramírez 1b275bd6a7 📌 Pin typing-extensions in tests for compatiblity with Python 3.8, dirty-equals, Pydantic (#965) 2024-06-04 01:34:21 +00:00
github-actions 866d9ecb29 📝 Update release notes 2024-06-04 00:39:40 +00: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
github-actions a319952be1 📝 Update release notes 2024-06-03 23:56:49 +00:00
Soof Golan 662bd641b8 ✏️ Fix broken link to @dataclass_transform (now PEP 681) in docs/features.md (#753)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: Patrick Arminio <patrick.arminio@gmail.com>
2024-06-03 23:56:30 +00:00
github-actions dcf4f58e81 📝 Update release notes 2024-05-10 21:00:41 +00:00
Sebastián Ramírez e4013acc54 👷 Update GitHub Actions to download and upload artifacts (#936) 2024-05-10 21:00:24 +00:00
github-actions df0f834227 📝 Update release notes 2024-05-07 18:32:44 +00:00
Sebastián Ramírez 5e592c9a0d 👷 Tweak CI for test-redistribute, add needed env vars for slim (#929) 2024-05-07 18:32:16 +00:00
Sebastián Ramírez c13b71056e 📝 Update release notes 0.0.18 2024-04-29 23:29:21 -07:00
Sebastián Ramírez 900e0d3371 🔖 Release version 0.0.18 2024-04-29 23:25:02 -07:00
github-actions a280b58c10 📝 Update release notes 2024-04-30 06:22:46 +00:00
Sebastián Ramírez 9ebbf255f7 Add sqlmodel-slim setup (#916) 2024-04-30 06:22:28 +00:00
github-actions 39cbf27904 📝 Update release notes 2024-04-30 00:01:02 +00:00
Sebastián Ramírez 28d0e76370 🔧 Re-enable MkDocs Material Social plugin (#915) 2024-04-30 00:00:40 +00:00
Sebastián Ramírez 0431c5bb26 🔖 Release version 0.0.17 0.0.17 2024-04-29 16:44:21 -07:00
github-actions 1c4f425f17 📝 Update release notes 2024-04-29 23:35:03 +00:00
dependabot[bot] 3ecbeacb46 ⬆ Bump actions/setup-python from 4 to 5 (#733)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-04-29 23:34:38 +00:00
github-actions 32353eeb07 📝 Update release notes 2024-04-29 23:26:22 +00:00
Sebastián Ramírez 7023896d7c 🔨 Update internal scripts and remove unused ones (#914) 2024-04-29 16:24:50 -07:00
github-actions 570cd9f10c 📝 Update release notes 2024-04-29 22:58:36 +00:00
Sebastián Ramírez 0b4989d0b2 🔧 Migrate from Poetry to PDM for the internal build config (#912) 2024-04-29 15:58:15 -07:00
github-actions f67867f974 📝 Update release notes 2024-04-29 22:11:20 +00:00
Sebastián Ramírez 2454694de3 ♻️ Refactor types to properly support Pydantic 2.7 (#913) 2024-04-29 15:11:02 -07:00
github-actions 6151f23e15 📝 Update release notes 2024-04-08 23:08:14 +00:00