Skip to content

v4.9.3

Choose a tag to compare

@nhumrich nhumrich released this 16 Dec 19:08
· 17 commits to main since this release

Changed

Pass Through All Types by Default

All interpolated values now pass through as native Python objects by default, allowing database drivers with custom codecs to handle any type natively.

class Point:
    def __init__(self, x, y):
        self.x, self.y = x, y

# With a custom asyncpg codec, this just works
p = Point(3, 4)
query, params = tsql.render(t"INSERT INTO coords VALUES ({p})")
# params[0] is the Point object, not a string

Format specs still stringify as before - {dt:%Y-%m-%d} will format the datetime to a string.

Fixed

Float Values in ESCAPED Style

Float values are now correctly rendered as numeric (19.99) instead of being quoted as strings ('19.99').

See commit f82e330 for full details.