PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: kayak/pypika (python)
Issue: [feature request] INSERT IGNORE
Please add the option of using 'INSERT IGNORE', right now all insertions are just 'INSERT'.
Pull request description: Fixes #15 added ignore function

Patch:
diff --git a/pypika/queries.py b/pypika/queries.py
index 885a4d5..9cb6c21 100644
--- a/pypika/queries.py
+++ b/pypika/queries.py
@@ -159,6 +159,7 @@ class QueryBuilder(Selectable, Term):
         self._columns = []
         self._values = []
         self._distinct = False
+        self._ignore = False
 
         self._wheres = None
         self._groupbys = []
@@ -250,6 +251,10 @@ class QueryBuilder(Selectable, Term):
     def distinct(self):
         self._distinct = True
 
+    @builder
+    def ignore(self):
+        self._ignore = True
+
     @builder
     def where(self, criterion):
         self._validate_term(criterion)
@@ -514,8 +519,9 @@ class QueryBuilder(Selectable, Term):
         )
 
     def _insert_sql(self):
-        return 'INSERT INTO {table}'.format(
-            table=self._insert_table
+        return 'INSERT {ignore}INTO {table}'.format(
+            table=self._insert_table,
+            ignore='IGNORE ' if self._ignore else ''
         )
 
     def _columns_sql(self):


Test patch:
diff --git a/pypika/tests/test_inserts.py b/pypika/tests/test_inserts.py
index d7646f2..1a728b4 100644
--- a/pypika/tests/test_inserts.py
+++ b/pypika/tests/test_inserts.py
@@ -72,11 +72,16 @@ class InsertIntoTests(unittest.TestCase):
 
         self.assertEqual('INSERT INTO "abc" ("foo","bar","buz") VALUES (1,\'a\',true)', str(query))
 
-    def test_insert_none_ignored(self):
+    def test_insert_none_skipped(self):
         query = Query.into(self.table_abc).insert()
 
         self.assertEqual('', str(query))
 
+    def test_insert_ignore(self):
+        query = Query.into(self.table_abc).insert(1).ignore()
+
+        self.assertEqual('INSERT IGNORE INTO "abc" VALUES (1)', str(query))
+
 
 class InsertSelectFromTests(unittest.TestCase):
     table_abc, table_efg, table_hij = Tables('abc', 'efg', 'hij')
@@ -127,6 +132,11 @@ class InsertSelectFromTests(unittest.TestCase):
                          'SELECT "efg"."foo","efg"."bar","hij"."fiz","hij"."buz" FROM "efg" '
                          'JOIN "hij" ON "efg"."id"="hij"."abc_id"', str(query))
 
+    def test_insert_star(self):
+        query = Query.into(self.table_abc).from_(self.table_efg).select('*').ignore()
+
+        self.assertEqual('INSERT IGNORE INTO "abc" SELECT * FROM "efg"', str(query))
+
 
 class SelectIntoTests(unittest.TestCase):
     table_abc, table_efg, table_hij = Tables('abc', 'efg', 'hij')
Repository: Kong/swrv (ts)
Issue: `isValidating` true when key is falsey
Hey there, 

it seems like the `isValidating` flag is true even if no request is currently happening (or has happened). This feels like a bug.

```js
const { isValidating } = useSWRV(() => null)

// `isValidating` is `true` even though no fetch is happening
```

Thank you!
Pull request description: fix(isValidating): add nullish check when no key
When a swrv key changes, if the key value resolves to a falsey value, then set the `isValidating` accordingly, since a falsey key is never validating.

Fixes #195

Patch:
diff --git a/src/use-swrv.ts b/src/use-swrv.ts
index 9c66493..e549caa 100644
--- a/src/use-swrv.ts
+++ b/src/use-swrv.ts
@@ -384,6 +384,7 @@ function useSWRV<Data = any, Error = any> (...args): IResponse<Data, Error> {
     watch(keyRef, (val) => {
       keyRef.value = val
       stateRef.key = val
+      stateRef.isValidating = Boolean(val)
       setRefCache(keyRef.value, stateRef, ttl)
 
       if (!IS_SERVER && !isHydrated && keyRef.value) {


Test patch:
diff --git a/tests/use-swrv.spec.tsx b/tests/use-swrv.spec.tsx
index e06b7ca..d412e24 100644
--- a/tests/use-swrv.spec.tsx
+++ b/tests/use-swrv.spec.tsx
@@ -683,6 +683,19 @@ describe('useSWRV - loading', () => {
 
     done()
   })
+
+  // #195
+  it('should return loading state isValidating with nullish key', async done => {
+    const vm = new Vue(defineComponent({
+      template: `<div>{{ error }}:{{this.isValidating ? 'loading' : 'ready'}}</div>`,
+      setup () {
+        return useSWRV(() => null)
+      }
+    })).$mount()
+
+    expect(vm.$el.textContent).toBe(':ready')
+    done()
+  })
 })
 
 describe('useSWRV - mutate', () => {