Skip to content

Add option to auto sort query results by created_at DESC #1663

@Aminadav

Description

@Aminadav

Many users expect recent records to appear first when listing data. Currently, data is returned in default order, forcing developers to repeatedly add "ORDER BY created_at DESC" to every query.

Why needed:

Sorting by newest first is the most common pattern for feeds, logs, tasks, events, comments, and versioned records. Currently, every time must implement it manually.

Proposal:

Add a configuration setting to automatically sort records by created_at descending when no explicit order is specified. This keeps full control for advanced use cases while streamlining the majority case.

Implementation idea:

Detect a timestamp or datetime column name (e.g. created_at, createdAt, timestamp, created) when generating or executing queries. If no explicit order is supplied, apply ORDER BY created_at DESC by default. This can be implemented once at the query builder or ORM layer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions