@@ -332,7 +332,7 @@ main = runMocha do
332 putVar var true
332 putVar var true
334 var <- makeVar
334 var <- makeVar
335− { db, store } <- setup IDBObjectStore.defaultParameters
335+ { db, store } <- setup IDBDatabase.defaultParameters
336 IDBDatabase.close db
336 IDBDatabase.close db
337 db <- IDBFactory.open "db" (Just 999) { onUpgradeNeeded : Just (onUpgradeNeeded var)
337 db <- IDBFactory.open "db" (Just 999) { onUpgradeNeeded : Just (onUpgradeNeeded var)
338 , onBlocked : Nothing
338 , onBlocked : Nothing
@@ -396,7 +396,7 @@ main = runMocha do
397 it "clear()" do
397 it "clear()" do
398 { db } <- setup
398 { db } <- setup
399− { storeParams: IDBObjectStore.defaultParameters
399+ { storeParams: IDBDatabase.defaultParameters
400 , onUpgradeNeeded: Just $ \_ store -> launchAff' do
400 , onUpgradeNeeded: Just $ \_ store -> launchAff' do
401 key <- IDBObjectStore.add store "patate" (Just 14)
401 key <- IDBObjectStore.add store "patate" (Just 14)
402 _ <- IDBObjectStore.clear store
402 _ <- IDBObjectStore.clear store
@@ -407,7 +407,7 @@ main = runMocha do
408 it "count()" do
408 it "count()" do
409 { db } <- setup
409 { db } <- setup
410− { storeParams: IDBObjectStore.defaultParameters
410+ { storeParams: IDBDatabase.defaultParameters
411 , onUpgradeNeeded: Just $ \_ store -> launchAff' do
411 , onUpgradeNeeded: Just $ \_ store -> launchAff' do
412 key <- IDBObjectStore.add store "patate" (Just 14)
412 key <- IDBObjectStore.add store "patate" (Just 14)
413 key <- IDBObjectStore.add store "autruche" (Just 42)
413 key <- IDBObjectStore.add store "autruche" (Just 42)
@@ -418,7 +418,7 @@ main = runMocha do
419 it "getKey()" do
419 it "getKey()" do
420 { db } <- setup
420 { db } <- setup
421− { storeParams: IDBObjectStore.defaultParameters
421+ { storeParams: IDBDatabase.defaultParameters
422 , onUpgradeNeeded: Just $ \_ store -> launchAff' do
422 , onUpgradeNeeded: Just $ \_ store -> launchAff' do
423 key <- IDBObjectStore.add store "patate" (Just 14)
423 key <- IDBObjectStore.add store "patate" (Just 14)
424 mkey <- IDBObjectStore.getKey store (IDBKeyRange.only 14)
424 mkey <- IDBObjectStore.getKey store (IDBKeyRange.only 14)
@@ -431,7 +431,7 @@ main = runMocha do
432 it "getAllKeys()" do
432 it "getAllKeys()" do
433 { db } <- setup
433 { db } <- setup
434− { storeParams: IDBObjectStore.defaultParameters
434+ { storeParams: IDBDatabase.defaultParameters
435 , onUpgradeNeeded: Just $ \_ store -> launchAff' do
435 , onUpgradeNeeded: Just $ \_ store -> launchAff' do
436 key1 <- IDBObjectStore.add store "patate" (Just 14)
436 key1 <- IDBObjectStore.add store "patate" (Just 14)
437 key2 <- IDBObjectStore.add store "autruche" (Just 42)
437 key2 <- IDBObjectStore.add store "autruche" (Just 42)
@@ -462,7 +462,7 @@ main = runMocha do
462 , onComplete: pure unit
462 , onComplete: pure unit
464 { db } <- setup
464 { db } <- setup
465− { storeParams: IDBObjectStore.defaultParameters
465+ { storeParams: IDBDatabase.defaultParameters
466 , onUpgradeNeeded: Just $ \_ store -> launchAff' do
466 , onUpgradeNeeded: Just $ \_ store -> launchAff' do
467 _ <- IDBObjectStore.openCursor store Nothing Next cb
467 _ <- IDBObjectStore.openCursor store Nothing Next cb
468 _ <- IDBObjectStore.openCursor store Nothing NextUnique cb
468 _ <- IDBObjectStore.openCursor store Nothing NextUnique cb
@@ -480,7 +480,7 @@ main = runMocha do
480 , onComplete: pure unit
480 , onComplete: pure unit
482 { db } <- setup
482 { db } <- setup
483− { storeParams: IDBObjectStore.defaultParameters
483+ { storeParams: IDBDatabase.defaultParameters
484 , onUpgradeNeeded: Just $ \_ store -> launchAff' do
484 , onUpgradeNeeded: Just $ \_ store -> launchAff' do
485 _ <- IDBObjectStore.openKeyCursor store Nothing Next cb
485 _ <- IDBObjectStore.openKeyCursor store Nothing Next cb
486 _ <- IDBObjectStore.openKeyCursor store Nothing NextUnique cb
486 _ <- IDBObjectStore.openKeyCursor store Nothing NextUnique cb
@@ -523,16 +523,16 @@ main = runMocha do
524 it "returns an IDBIndex and the properties are set correctly" do
524 it "returns an IDBIndex and the properties are set correctly" do
525 { db, index } <- setup
525 { db, index } <- setup
526− { storeParams : IDBObjectStore.defaultParameters
526+ { storeParams : IDBDatabase.defaultParameters
527− , indexParams : IDBIndex.defaultParameters
527+ , indexParams : IDBObjectStore.defaultParameters
528 , onUpgradeNeeded : Nothing
528 , onUpgradeNeeded : Nothing
529 , keyPath : []
529 , keyPath : []
530 , values : []
530 , values : []
532 IDBIndex.name index `shouldEqual` "index"
532 IDBIndex.name index `shouldEqual` "index"
533 IDBIndex.keyPath index `shouldEqual` []
533 IDBIndex.keyPath index `shouldEqual` []
534− IDBIndex.unique index `shouldEqual` IDBIndex.defaultParameters.unique
534+ IDBIndex.unique index `shouldEqual` IDBObjectStore.defaultParameters.unique
535− IDBIndex.multiEntry index `shouldEqual` IDBIndex.defaultParameters.multiEntry
535+ IDBIndex.multiEntry index `shouldEqual` IDBObjectStore.defaultParameters.multiEntry
536 tearDown db
536 tearDown db
538 it "attempt to create an index that requires unique values on an object store already contains duplicates" do
538 it "attempt to create an index that requires unique values on an object store already contains duplicates" do
@@ -540,7 +540,7 @@ main = runMocha do
540 txVar <- makeVar
540 txVar <- makeVar
541 dbVar <- makeVar
541 dbVar <- makeVar
542 res <- attempt $ setup
542 res <- attempt $ setup
543− { storeParams : IDBObjectStore.defaultParameters
543+ { storeParams : IDBDatabase.defaultParameters
544 , indexParams : { unique : true
544 , indexParams : { unique : true
545 , multiEntry : false
545 , multiEntry : false
@@ -565,7 +565,7 @@ main = runMocha do
565 { storeParams : { keyPath : ["key"]
565 { storeParams : { keyPath : ["key"]
566 , autoIncrement : false
566 , autoIncrement : false
568− , indexParams : IDBIndex.defaultParameters
568+ , indexParams : IDBObjectStore.defaultParameters
569 , keyPath : ["indexedProperty"]
569 , keyPath : ["indexedProperty"]
570 , values : [ { key: "key1", indexedProperty: "indexed_1" } :+: Nothing
570 , values : [ { key: "key1", indexedProperty: "indexed_1" } :+: Nothing
571 , { key: "key2", indexedProperty: "indexed_2" } :+: Nothing
571 , { key: "key2", indexedProperty: "indexed_2" } :+: Nothing
@@ -579,8 +579,8 @@ main = runMocha do
580 it "empty keyPath" do
580 it "empty keyPath" do
581 { db } <- setup
581 { db } <- setup
582− { storeParams : IDBObjectStore.defaultParameters
582+ { storeParams : IDBDatabase.defaultParameters
583− , indexParams : IDBIndex.defaultParameters
583+ , indexParams : IDBObjectStore.defaultParameters
584 , keyPath : []
584 , keyPath : []
585 , values : [ "object_1" :+: (Just $ toKey 1)
585 , values : [ "object_1" :+: (Just $ toKey 1)
586 , "object_2" :+: (Just $ toKey 2)
586 , "object_2" :+: (Just $ toKey 2)
@@ -598,7 +598,7 @@ main = runMocha do
598 { storeParams : { keyPath: ["key"]
598 { storeParams : { keyPath: ["key"]
599 , autoIncrement: false
599 , autoIncrement: false
601− , indexParams : IDBIndex.defaultParameters
601+ , indexParams : IDBObjectStore.defaultParameters
602 , keyPath : ["i"]
602 , keyPath : ["i"]
603 , values : [ { key: "date", i: (toKey date) } :+: Nothing
603 , values : [ { key: "date", i: (toKey date) } :+: Nothing
@@ -614,7 +614,7 @@ main = runMocha do
614 { storeParams : { keyPath: ["key"]
614 { storeParams : { keyPath: ["key"]
615 , autoIncrement: false
615 , autoIncrement: false
617− , indexParams : IDBIndex.defaultParameters
617+ , indexParams : IDBObjectStore.defaultParameters
618 , keyPath : ["i"]
618 , keyPath : ["i"]
619 , values : [ { key: "num", i: (toKey num) } :+: Nothing
619 , values : [ { key: "num", i: (toKey num) } :+: Nothing
@@ -630,7 +630,7 @@ main = runMocha do
630 { storeParams : { keyPath: ["key"]
630 { storeParams : { keyPath: ["key"]
631 , autoIncrement: false
631 , autoIncrement: false
633− , indexParams : IDBIndex.defaultParameters
633+ , indexParams : IDBObjectStore.defaultParameters
634 , keyPath : ["i"]
634 , keyPath : ["i"]
635 , values : [ { key: "array", i: (toKey array) } :+: Nothing
635 , values : [ { key: "array", i: (toKey array) } :+: Nothing
@@ -643,7 +643,7 @@ main = runMocha do
643 it "openKeyCursor() - throw InvalidStateError on index deleted by aborted upgrade" do
643 it "openKeyCursor() - throw InvalidStateError on index deleted by aborted upgrade" do
644 res <- attempt $ setup
644 res <- attempt $ setup
645 { storeParams : { keyPath: ["key"], autoIncrement: false }
645 { storeParams : { keyPath: ["key"], autoIncrement: false }
646− , indexParams : IDBIndex.defaultParameters
646+ , indexParams : IDBObjectStore.defaultParameters
647 , keyPath : ["indexedProperty"]
647 , keyPath : ["indexedProperty"]
648 , values : [ { key: 14, indexedProperty: "patate" } :+: Nothing
648 , values : [ { key: 14, indexedProperty: "patate" } :+: Nothing
@@ -668,7 +668,7 @@ main = runMocha do
668 it "openKeyCursor() - throw TransactionInactiveError on aborted transaction" do
668 it "openKeyCursor() - throw TransactionInactiveError on aborted transaction" do
669 { db } <- setup
669 { db } <- setup
670 { storeParams : { keyPath: ["key"], autoIncrement: false }
670 { storeParams : { keyPath: ["key"], autoIncrement: false }
671− , indexParams : IDBIndex.defaultParameters
671+ , indexParams : IDBObjectStore.defaultParameters
672 , keyPath : ["indexedProperty"]
672 , keyPath : ["indexedProperty"]
673 , values : [ { key: 14, indexedProperty: "patate" } :+: Nothing
673 , values : [ { key: 14, indexedProperty: "patate" } :+: Nothing
@@ -694,7 +694,7 @@ main = runMocha do
694 it "openKeyCursor() - throw InvalidStateError when the index is deleted" do
694 it "openKeyCursor() - throw InvalidStateError when the index is deleted" do
695 { db } <- setup
695 { db } <- setup
696 { storeParams : { keyPath: ["key"], autoIncrement: false }
696 { storeParams : { keyPath: ["key"], autoIncrement: false }
697− , indexParams : IDBIndex.defaultParameters
697+ , indexParams : IDBObjectStore.defaultParameters
698 , keyPath : ["indexedProperty"]
698 , keyPath : ["indexedProperty"]
699 , values : [ { key: 14, indexedProperty: "patate" } :+: Nothing
699 , values : [ { key: 14, indexedProperty: "patate" } :+: Nothing
@@ -717,7 +717,7 @@ main = runMocha do
717 it "openCursor() - throw InvalidStateError on index deleted by aborted upgrade" do
717 it "openCursor() - throw InvalidStateError on index deleted by aborted upgrade" do
718 res <- attempt $ setup
718 res <- attempt $ setup
719 { storeParams : { keyPath: ["key"], autoIncrement: false }
719 { storeParams : { keyPath: ["key"], autoIncrement: false }
720− , indexParams : IDBIndex.defaultParameters
720+ , indexParams : IDBObjectStore.defaultParameters
721 , keyPath : ["indexedProperty"]
721 , keyPath : ["indexedProperty"]
722 , values : [ { key: 14, indexedProperty: "patate" } :+: Nothing
722 , values : [ { key: 14, indexedProperty: "patate" } :+: Nothing
@@ -742,7 +742,7 @@ main = runMocha do
742 it "openCursor() - throw TransactionInactiveError on aborted transaction" do
742 it "openCursor() - throw TransactionInactiveError on aborted transaction" do
743 { db } <- setup
743 { db } <- setup
744 { storeParams : { keyPath: ["key"], autoIncrement: false }
744 { storeParams : { keyPath: ["key"], autoIncrement: false }
745− , indexParams : IDBIndex.defaultParameters
745+ , indexParams : IDBObjectStore.defaultParameters
746 , keyPath : ["indexedProperty"]
746 , keyPath : ["indexedProperty"]
747 , values : [ { key: 14, indexedProperty: "patate" } :+: Nothing
747 , values : [ { key: 14, indexedProperty: "patate" } :+: Nothing
@@ -768,7 +768,7 @@ main = runMocha do
768 it "openCursor() - throw InvalidStateError when the index is deleted" do
768 it "openCursor() - throw InvalidStateError when the index is deleted" do
769 { db } <- setup
769 { db } <- setup
770 { storeParams : { keyPath: ["key"], autoIncrement: false }
770 { storeParams : { keyPath: ["key"], autoIncrement: false }
771− , indexParams : IDBIndex.defaultParameters
771+ , indexParams : IDBObjectStore.defaultParameters
772 , keyPath : ["indexedProperty"]
772 , keyPath : ["indexedProperty"]
773 , values : [ { key: 14, indexedProperty: "patate" } :+: Nothing
773 , values : [ { key: 14, indexedProperty: "patate" } :+: Nothing
@@ -790,7 +790,7 @@ main = runMocha do
791 it "getKey() - multiEntry - adding keys" do
791 it "getKey() - multiEntry - adding keys" do
792 { db } <- setup
792 { db } <- setup
793− { storeParams : IDBObjectStore.defaultParameters
793+ { storeParams : IDBDatabase.defaultParameters
794 , indexParams : { unique: false, multiEntry: true }
794 , indexParams : { unique: false, multiEntry: true }
795 , keyPath : ["name"]
795 , keyPath : ["name"]
796 , values : [ { name: ["patate", "autruche"] } :+: (Just $ toKey 1)
796 , values : [ { name: ["patate", "autruche"] } :+: (Just $ toKey 1)
@@ -812,7 +812,7 @@ main = runMocha do
812 it "get() - returns the record with the first key in the range" do
812 it "get() - returns the record with the first key in the range" do
813 { db } <- setup
813 { db } <- setup
814 { storeParams : { keyPath: ["key"], autoIncrement: false }
814 { storeParams : { keyPath: ["key"], autoIncrement: false }
815− , indexParams : IDBIndex.defaultParameters
815+ , indexParams : IDBObjectStore.defaultParameters
816 , keyPath : ["indexedProperty"]
816 , keyPath : ["indexedProperty"]
817 , values : [ { key: 14, indexedProperty: "patate" } :+: Nothing
817 , values : [ { key: 14, indexedProperty: "patate" } :+: Nothing
818 , { key: 42, indexedProperty: "autruche" } :+: Nothing
818 , { key: 42, indexedProperty: "autruche" } :+: Nothing
@@ -860,8 +860,8 @@ main = runMocha do
861 it "continue() - iterate to the next record" do
861 it "continue() - iterate to the next record" do
862 { db } <- setup
862 { db } <- setup
863− { storeParams : IDBObjectStore.defaultParameters
863+ { storeParams : IDBDatabase.defaultParameters
864− , indexParams : IDBIndex.defaultParameters
864+ , indexParams : IDBObjectStore.defaultParameters
865 , keyPath : []
865 , keyPath : []
866 , values : [ "cupcake" :+: (Just $ toKey 4)
866 , values : [ "cupcake" :+: (Just $ toKey 4)
867 , "pancake" :+: (Just $ toKey 2)
867 , "pancake" :+: (Just $ toKey 2)
@@ -899,8 +899,8 @@ main = runMocha do
900 it "continue() - attempt to iterate in the wrong direction" do
900 it "continue() - attempt to iterate in the wrong direction" do
901 { db } <- setup
901 { db } <- setup
902− { storeParams : IDBObjectStore.defaultParameters
902+ { storeParams : IDBDatabase.defaultParameters
903− , indexParams : IDBIndex.defaultParameters
903+ , indexParams : IDBObjectStore.defaultParameters
904 , keyPath : []
904 , keyPath : []
905 , values : [ "cupcake" :+: (Just $ toKey 4)
905 , values : [ "cupcake" :+: (Just $ toKey 4)
906 , "pancake" :+: (Just $ toKey 2)
906 , "pancake" :+: (Just $ toKey 2)
@@ -936,7 +936,7 @@ main = runMocha do
936 it "advance() - iterate cursor number of times specified by count" do
936 it "advance() - iterate cursor number of times specified by count" do
937 { db } <- setup
937 { db } <- setup
938 { storeParams : { keyPath: ["pKey"], autoIncrement: false }
938 { storeParams : { keyPath: ["pKey"], autoIncrement: false }
939− , indexParams : IDBIndex.defaultParameters
939+ , indexParams : IDBObjectStore.defaultParameters
940 , keyPath : []
940 , keyPath : []
941 , values : [ { pKey: "pkey_0", iKey: "ikey_0" } :+: Nothing
941 , values : [ { pKey: "pkey_0", iKey: "ikey_0" } :+: Nothing
942 , { pKey: "pkey_1", iKey: "ikey_1" } :+: Nothing
942 , { pKey: "pkey_1", iKey: "ikey_1" } :+: Nothing
@@ -975,7 +975,7 @@ main = runMocha do
975 it "delete() - remove a record from the object store" do
975 it "delete() - remove a record from the object store" do
976 { db } <- setup
976 { db } <- setup
977 { storeParams : { keyPath: ["pKey"], autoIncrement: false }
977 { storeParams : { keyPath: ["pKey"], autoIncrement: false }
978− , indexParams : IDBIndex.defaultParameters
978+ , indexParams : IDBObjectStore.defaultParameters
979 , keyPath : []
979 , keyPath : []
980 , values : [ { pKey: "pkey_0", iKey: "ikey_0" } :+: Nothing
980 , values : [ { pKey: "pkey_0", iKey: "ikey_0" } :+: Nothing
981 , { pKey: "pkey_1", iKey: "ikey_1" } :+: Nothing
981 , { pKey: "pkey_1", iKey: "ikey_1" } :+: Nothing
@@ -1009,7 +1009,7 @@ main = runMocha do
1009 it "update() - modify a record in the object store" do
1009 it "update() - modify a record in the object store" do
1010 { db } <- setup
1010 { db } <- setup
1011 { storeParams : { keyPath: ["pKey"], autoIncrement: false }
1011 { storeParams : { keyPath: ["pKey"], autoIncrement: false }
1012− , indexParams : IDBIndex.defaultParameters
1012+ , indexParams : IDBObjectStore.defaultParameters
1013 , keyPath : []
1013 , keyPath : []
1014 , values : [ { pKey: "pkey_0", iKey: "ikey_0" } :+: Nothing
1014 , values : [ { pKey: "pkey_0", iKey: "ikey_0" } :+: Nothing
@@ -1041,7 +1041,7 @@ main = runMocha do
1041 it "update() - throw ReadOnlyError after update on ReadOnly transaction" do
1041 it "update() - throw ReadOnlyError after update on ReadOnly transaction" do
1042 { db } <- setup
1042 { db } <- setup
1043 { storeParams : { keyPath: ["pKey"], autoIncrement: false }
1043 { storeParams : { keyPath: ["pKey"], autoIncrement: false }
1044− , indexParams : IDBIndex.defaultParameters
1044+ , indexParams : IDBObjectStore.defaultParameters
1045 , keyPath : []
1045 , keyPath : []
1046 , values : [ { pKey: "pkey_0", iKey: "ikey_0" } :+: Nothing
1046 , values : [ { pKey: "pkey_0", iKey: "ikey_0" } :+: Nothing