MaddyUnderStars / MaddyUnderStars/shoot

use `BaseEntity.insert` instead of `.save()` for new rows

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

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
61
Forks
5
Avg merge
3d 10h
Merged PRs (30d)
1

Description

`.save()` executes a select first to see if it's truly new, which isn't necessary e.g. for user registration.
Either move to `Entity.insert(Entity.create({})` or add `insert` alias to BaseEntity and call that?

Contributor guide

No contributing guide indexed for this repository

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 locating BaseEntity and the user-registration call site that currently uses .save(), then compare the available Entity.insert approach with the existing persistence flow. The change is complete when new-row registration no longer performs the unnecessary select while preserving the current behavior and passing the repository's existing checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.