luckyframework / luckyframework/avram

Don't allow unoptimised queries

Open
#23 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Crystal
Stars
183
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Continue of this conversation part: https://gitter.im/luckyframework/Lobby?at=5c093ec628907a3c7bd9ccf6

To disallow bad queries that don't have indexes during compile time check if a query field is used that does not contain an index. This is a bad query and should not allow to pass this state and a database index should be added.

I'm not a database expert but the feature should not export find_by_field functions or in the query builder where fields.

There should be an override method like where_no_index to support also queries that are not optimized.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the query builder's where fields and the generated find_by_field functions mentioned in the issue. Determine how compile-time query checks and database indexes are represented, then define what successful rejection and the proposed where_no_index override should look like.

Written by the indexing model from the issue text.

Assessment

Tech stack
crystal, postgresql
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.