Flush does not work
See original GitHub issueFlush 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:
- Created a year ago
- Comments:8 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It gets me thinking…maybe i should oftner wait until i fix something so i get more sponsoring 🤣 … just kidding…maybe
i am still on it…had just too much work past days. Just as information.