luckyframework / luckyframework/avram

Ensure order is set to avoid non deterministic queries

Open
#782 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Crystal
Stars
183
Forks
67
PR merge metrics
No merged PRs in 30d

Description

In past projects, we’ve been bit occasionally by implicit code in Rails that queried collections and would USUALLY, but not always, return in the order of ID ASC.

Order is non deterministic in SQL unless specified, so I was thinking that bringing in some config (since we don’t want to break old apps) to optionally hard raise when order is missing might be a really nice feature.

It’s meant to address the same type of concerns that https://github.com/santib/chaotic_order addresses in Rails.

This is something I’d be happy to take a crack at if there’s appetite for this being part of core Avram. @matthewmcgarvey @jwoertink any thoughts?

Contributor guide

Open the contributing guide

Research direction

The issue does not name specific files, tests, or entry points. Start by locating Avram's query ordering and configuration code, then define an opt-in setting that raises when a collection query lacks an order while preserving existing application behavior; done means the setting works and unordered queries are covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
crystal, postgresql
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.