Skip to content
This repository was archived by the owner on Aug 19, 2024. It is now read-only.
This repository was archived by the owner on Aug 19, 2024. It is now read-only.

non unique columns and order by primary key #10

@d42

Description

@d42

I'm not a database expert, however from what I gather, paging results from a query with ORDER BY clause on a column that's not unique and contains lots of repeating values results in artifacts like rows repeating across pages

The solution I have found is including primary in order by, however doing this in datatables involves copypasting whole _json() method

I'd like to know if my reasoning is sound, and at least suggest that perhaps

    filtered_records = query.count()
    query = query.slice(start, start + length)

    return {
        "draw": draw,
        "recordsTotal": total_records,
        "recordsFiltered": filtered_records,
        "data": [
            self.output_instance(instance) for instance in query.all()
        ]
    }`

could be refactored for different method, for easier sublassing? :3

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