String functions¶
Concat¶
Length¶
Lower¶
Ltrim¶
Replace¶
- class piccolo.query.functions.string.Replace(identifier: Column | QueryString, old: str, new: str, alias: str | None = None)¶
Replace any instances of
oldin the string withnew.For example, a really basic slugify implementation:
class Venue(Table): name = Varchar() >>> await Venue.select(Replace(Venue.name, ' ', '-')) [{'name': 'Amazing-Venue'}]