Skip to content

Conversation

@robinvandernoord
Copy link
Member

@robinvandernoord robinvandernoord commented Mar 25, 2025

Python 3.14 works, but required some workarounds.
I have updated the annotation parsing logic for the new annotationlib.


other Changes

  • Add t-string support for python 3.14 to safely quote SQL:
bobby_tables = "Robert'); DROP TABLE Students;--"
rows = db.executesql(t"SELECT * FROM unhackable where name = {bobby_tables}")`

# equals:
# db.executesql("SELECT * FROM unhackable where name = %s", placeholders=[bobby_tables])
# db.executesql("SELECT * FROM unhackable where name = %(name)s", placeholders=dict(name=bobby_tables))

# alternative, even more magical syntax:
name = bobby_tables
rows = db.executesql(t"SELECT * FROM unhackable where {name = }")
  • .join() now supports nested relationships: e.g. Article.join("author.articles") to get the article with its author and all articles by that author. (you would access this like article.author.articles)

  • core.py has been split up into multiple files to seperate concerns better. External exports are not affected but direct imports from typedal.core could stop working.

  • This PR also drops Python 3.10 support since keeping such a wide range of compatibility makes it hard to work with.


Due to the last two changes which could be potentially breaking, we will conservatively bump this next version to 4.0

…ion to prevent breaking changes (clirunner in test)
…n 3.14

```python
bobby_tables = "Robert'); DROP TABLE Students;--"
rows = db.executesql(t"SELECT * FROM unhackable where name = {bobby_tables}")

    name = "Robert'); DROP TABLE Students;--"
    rows = database.executesql(t"SELECT * FROM unhackable where {name = }")
```
…elationship'), still some todo's for test coverage
@robinvandernoord robinvandernoord changed the title Python3.14 support TypeDAL 4.0 | Python 3.14 support Oct 1, 2025
@robinvandernoord
Copy link
Member Author

pydal and psycopg2 have been updated to support python 3.14, meaning this PR can be merged and TypeDAL 4.0 can be released!

@robinvandernoord robinvandernoord merged commit 5b6405b into master Oct 12, 2025
0 of 2 checks passed
@robinvandernoord robinvandernoord deleted the python3.14 branch October 12, 2025 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants