metabase / metabase/toucan

Better support for objects that don't have a primary key called :id

Open
#3 2 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
Clojure
Stars
576
Forks
48
PR merge metrics
No merged PRs in 30d

Description

I think we could add a method to `IModel` called `primary-key` or something like that that could be used to get field(s) that should be used as the primary key (default implementation would return `:id`). It could accept either a keyword (for a single-column key) or a sequence of keywords for multiple-column keys.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the IModel definition and the code paths that assume a primary key named :id. Review how model fields are used for lookup and persistence, then determine the tests needed for single-key and composite-key models; done means both forms work while the default remains :id.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
backend, database
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.