question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flush does not work

See original GitHub issue

Flush does not work. It could be because this model has a list as a primary key?

import { Model } from "pinia-orm";

export default class HumanSavedShow extends Model {
  static entity = "HumanSavedShow";
  static primaryKey = ["human_id", "show_id"];

  static fields() {
    return {
      human_id: this.uid(),
      show_id: this.uid(),
      added_at: this.number(0)
    };
  }
}
<template>
  <button @click="testFlush">Flush does not work</click>
</template>


<script setup lang="ts">
import { useRepo } from "pinia-orm";
import HumanSavedShow from "@/models/HumanSavedShow";

const SAVEDSHOWS = useRepo(Spotify_HumanSavedShow)

function testFlush() {
  console.log('There are ', SAVEDSHOWS.all().length, 'Shows');
  useRepo(Spotify_HumanSavedShow).flush();
  SAVEDSHOWS.flush();
  console.log('There are ', SAVEDSHOWS.all().length, 'Shows');
  SAVEDSHOWS.new()
  console.log('There are ', SAVEDSHOWS.all().length, 'Shows');
}
</script>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  name: "App",
});
</script>

I would expect flush to delete all the records stored. https://next.vuex-orm.org/guide/repository/deleting-data.html#deleting-data

But it doesn’t delete anything.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
CodeDreddcommented, Jun 24, 2022

It gets me thinking…maybe i should oftner wait until i fix something so i get more sponsoring 🤣 … just kidding…maybe

1reaction
CodeDreddcommented, Jun 28, 2022

i am still on it…had just too much work past days. Just as information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

6 Common Reasons Why Your Toilet Won't Flush - HomeServe
The Toilet Won't Flush Right Due to a Problem With Your Toilet Handle · The Toilet Won't Flush Because Your Tank's Water Level...
Read more >
Solved! What to Do When the Toilet Won't Flush - Bob Vila
While this may sound too simple to actually work, hot water and dish soap is actually an effective way for fixing a toilet...
Read more >
4 Reasons Your Toilet Won't Flush & 4 Ways to Fix It!
Problem: Using too much toilet paper or attempting to flush anything other than toilet paper down the toilet can clog the pipe and...
Read more >
Toilet Not Flushing? How to Fix a Toilet that Won't Flush
One of the most common reasons why a homeowner's toilet won't flush properly is because the toilet is clogged. Clogs often develop as...
Read more >
Here's what to do when the toilet flusher won't flush - TODAY
The most common cause for this problem, and the one that's easiest to fix, is a poorly seated flapper, aka a running toilet....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found