Skip to content

Add Replace function #1376

@dantownsend

Description

@dantownsend

It would be useful to have the Replace function, for manipulating strings in queries.

For example, a really basic slugify implementation::

class Venue(Table):
    name = Varchar()

>>> await Venue.select(Replace(Venue.name, ' ', '-'))
[{'name': 'Amazing-Venue'}]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions