dexie 3.2.0 → 3.2.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +1 -1
- package/README.md +10 -10
- package/dist/dexie.d.ts +35 -35
- package/dist/dexie.js +23 -5
- package/dist/dexie.js.map +1 -1
- package/dist/dexie.min.js +1 -1
- package/dist/dexie.min.js.map +1 -1
- package/dist/dexie.mjs +23 -5
- package/dist/dexie.mjs.map +1 -1
- package/dist/modern/dexie.min.mjs +1 -1
- package/dist/modern/dexie.min.mjs.map +1 -1
- package/dist/modern/dexie.mjs +23 -5
- package/dist/modern/dexie.mjs.map +1 -1
- package/package.json +1 -1
package/CONTRIBUTING.md
CHANGED
|
@@ -6,7 +6,7 @@ We appreciate contributions in forms of:
|
|
|
6
6
|
* issues
|
|
7
7
|
* help answering questions in [issues](https://github.com/dfahlander/Dexie.js/issues) and on [stackoverflow](https://stackexchange.com/filters/233583/dexie-stackoverflow)
|
|
8
8
|
* fixing bugs via pull-requests
|
|
9
|
-
* developing addons or other [derived work](
|
|
9
|
+
* developing addons or other [derived work](https://dexie.org/docs/DerivedWork)
|
|
10
10
|
* promoting Dexie.js
|
|
11
11
|
* sharing ideas
|
|
12
12
|
|
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Dexie.js
|
|
2
2
|
========
|
|
3
3
|
|
|
4
|
-
[![NPM Version][npm-image]][npm-url] [](https://travis-ci.com/dfahlander/Dexie.js)[](https://travis-ci.com/dfahlander/Dexie.js)[](https://www.browserstack.com)
|
|
5
5
|
|
|
6
|
-
Dexie.js is a wrapper library for indexedDB - the standard database in the browser.
|
|
6
|
+
Dexie.js is a wrapper library for indexedDB - the standard database in the browser. https://dexie.org
|
|
7
7
|
|
|
8
8
|
#### Why?
|
|
9
9
|
Dexie solves three main issues with the native IndexedDB API:
|
|
@@ -46,15 +46,15 @@ Dexie provides a neat database API with a well thought-through API design, robus
|
|
|
46
46
|
```
|
|
47
47
|
Yes, it's that simple.
|
|
48
48
|
|
|
49
|
-
[Tutorial](
|
|
49
|
+
[Tutorial](https://dexie.org/docs/Tutorial)
|
|
50
50
|
|
|
51
|
-
[API Reference](
|
|
51
|
+
[API Reference](https://dexie.org/docs/API-Reference)
|
|
52
52
|
|
|
53
|
-
[Samples](
|
|
53
|
+
[Samples](https://dexie.org/docs/Samples)
|
|
54
54
|
|
|
55
55
|
### Performance
|
|
56
56
|
|
|
57
|
-
Dexie has kick-ass performance. Its [bulk methods](
|
|
57
|
+
Dexie has kick-ass performance. Its [bulk methods](https://dexie.org/docs/Table/Table.bulkPut()) take advantage of a lesser-known feature in IndexedDB that makes it possible to store stuff without listening to every onsuccess event. This speeds up the performance to a maximum.
|
|
58
58
|
|
|
59
59
|
#### Supported operations
|
|
60
60
|
```js
|
|
@@ -108,7 +108,7 @@ uniqueKeys(): Promise;
|
|
|
108
108
|
until(filter: (value) => boolean, includeStopEntry?: boolean): Collection;
|
|
109
109
|
update(key: Key, changes: { [keyPath: string]: any }): Promise;
|
|
110
110
|
```
|
|
111
|
-
This is a mix of methods from [WhereClause](
|
|
111
|
+
This is a mix of methods from [WhereClause](https://dexie.org/docs/WhereClause/WhereClause), [Table](https://dexie.org/docs/Table/Table) and [Collection](https://dexie.org/docs/Collection/Collection). Dive into the [API reference](https://dexie.org/docs/API-Reference) to see the details.
|
|
112
112
|
|
|
113
113
|
#### Hello World (ES2016 / ES7)
|
|
114
114
|
```js
|
|
@@ -189,17 +189,17 @@ db.transaction('rw', db.friends, async() => {
|
|
|
189
189
|
|
|
190
190
|
Samples
|
|
191
191
|
-------
|
|
192
|
-
|
|
192
|
+
https://dexie.org/docs/Samples
|
|
193
193
|
|
|
194
194
|
https://github.com/dfahlander/Dexie.js/tree/master/samples
|
|
195
195
|
|
|
196
196
|
Knowledge Base
|
|
197
197
|
-----
|
|
198
|
-
[
|
|
198
|
+
[https://dexie.org/docs/Questions-and-Answers](https://dexie.org/docs/Questions-and-Answers)
|
|
199
199
|
|
|
200
200
|
Website
|
|
201
201
|
-------
|
|
202
|
-
[
|
|
202
|
+
[https://dexie.org](https://dexie.org)
|
|
203
203
|
|
|
204
204
|
Install over npm
|
|
205
205
|
----------------
|
package/dist/dexie.d.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*
|
|
5
5
|
* By David Fahlander, david.fahlander@gmail.com
|
|
6
6
|
*
|
|
7
|
-
* Version 3.2.
|
|
7
|
+
* Version 3.2.1-beta.1, Fri Nov 19 2021
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* https://dexie.org
|
|
10
10
|
*
|
|
11
11
|
* Apache License Version 2.0, January 2004, http://www.apache.org/licenses/
|
|
12
12
|
*/
|
|
@@ -551,9 +551,9 @@ export interface DBCoreIndex {
|
|
|
551
551
|
readonly name: string | null;
|
|
552
552
|
/** True if this index represents the primary key */
|
|
553
553
|
readonly isPrimaryKey?: boolean;
|
|
554
|
-
/** True if this index represents the primary key and is not inbound (
|
|
554
|
+
/** True if this index represents the primary key and is not inbound (https://dexie.org/docs/inbound) */
|
|
555
555
|
readonly outbound?: boolean;
|
|
556
|
-
/** True if and only if keyPath is an array (
|
|
556
|
+
/** True if and only if keyPath is an array (https://dexie.org/docs/Compound-Index) */
|
|
557
557
|
readonly compound?: boolean;
|
|
558
558
|
/** keyPath, null for primary key, string for single-property indexes, Array<string> for compound indexes */
|
|
559
559
|
readonly keyPath: null | string | string[];
|
|
@@ -790,7 +790,7 @@ export interface Dexie extends Database {
|
|
|
790
790
|
* Common base class for all errors originating from Dexie.js except TypeError,
|
|
791
791
|
* SyntaxError and RangeError.
|
|
792
792
|
*
|
|
793
|
-
*
|
|
793
|
+
* https://dexie.org/docs/DexieErrors/DexieError
|
|
794
794
|
*
|
|
795
795
|
*/
|
|
796
796
|
export interface DexieError extends Error {
|
|
@@ -804,7 +804,7 @@ export interface DexieError extends Error {
|
|
|
804
804
|
* List of the names of auto-generated error classes that extends DexieError
|
|
805
805
|
* and shares the interface of DexieError.
|
|
806
806
|
*
|
|
807
|
-
* Each error should be documented at
|
|
807
|
+
* Each error should be documented at https://dexie.org/docs/DexieErrors/Dexie.<errname>
|
|
808
808
|
*
|
|
809
809
|
* The generic type DexieExceptionClasses is a map of full error name to
|
|
810
810
|
* error constructor. The DexieExceptionClasses is mixed in into Dexie,
|
|
@@ -824,64 +824,64 @@ export interface DexieError extends Error {
|
|
|
824
824
|
* }
|
|
825
825
|
*/
|
|
826
826
|
export type DexieErrors = {
|
|
827
|
-
//
|
|
827
|
+
// https://dexie.org/docs/DexieErrors/Dexie.OpenFailedError
|
|
828
828
|
OpenFailed: "OpenFailedError";
|
|
829
|
-
//
|
|
829
|
+
// https://dexie.org/docs/DexieErrors/Dexie.VersionChangeError
|
|
830
830
|
VersionChange: "VersionChangeError";
|
|
831
|
-
//
|
|
831
|
+
// https://dexie.org/docs/DexieErrors/Dexie.SchemaError
|
|
832
832
|
Schema: "SchemaError";
|
|
833
|
-
//
|
|
833
|
+
// https://dexie.org/docs/DexieErrors/Dexie.UpgradeError
|
|
834
834
|
Upgrade: "UpgradeError";
|
|
835
|
-
//
|
|
835
|
+
// https://dexie.org/docs/DexieErrors/Dexie.InvalidTableError
|
|
836
836
|
InvalidTable: "InvalidTableError";
|
|
837
|
-
//
|
|
837
|
+
// https://dexie.org/docs/DexieErrors/Dexie.MissingAPIError
|
|
838
838
|
MissingAPI: "MissingAPIError";
|
|
839
|
-
//
|
|
839
|
+
// https://dexie.org/docs/DexieErrors/Dexie.NoSuchDatabaseError
|
|
840
840
|
NoSuchDatabase: "NoSuchDatabaseError";
|
|
841
|
-
//
|
|
841
|
+
// https://dexie.org/docs/DexieErrors/Dexie.InvalidArgumentError
|
|
842
842
|
InvalidArgument: "InvalidArgumentError";
|
|
843
|
-
//
|
|
843
|
+
// https://dexie.org/docs/DexieErrors/Dexie.SubTransactionError
|
|
844
844
|
SubTransaction: "SubTransactionError";
|
|
845
|
-
//
|
|
845
|
+
// https://dexie.org/docs/DexieErrors/Dexie.UnsupportedError
|
|
846
846
|
Unsupported: "UnsupportedError";
|
|
847
|
-
//
|
|
847
|
+
// https://dexie.org/docs/DexieErrors/Dexie.InternalError
|
|
848
848
|
Internal: "InternalError";
|
|
849
|
-
//
|
|
849
|
+
// https://dexie.org/docs/DexieErrors/Dexie.DatabaseClosedError
|
|
850
850
|
DatabaseClosed: "DatabaseClosedError";
|
|
851
|
-
//
|
|
851
|
+
// https://dexie.org/docs/DexieErrors/Dexie.PrematureCommitError
|
|
852
852
|
PrematureCommit: "PrematureCommitError";
|
|
853
|
-
//
|
|
853
|
+
// https://dexie.org/docs/DexieErrors/Dexie.ForeignAwaitError
|
|
854
854
|
ForeignAwait: "ForeignAwaitError";
|
|
855
|
-
//
|
|
855
|
+
// https://dexie.org/docs/DexieErrors/Dexie.UnknownError
|
|
856
856
|
Unknown: "UnknownError";
|
|
857
|
-
//
|
|
857
|
+
// https://dexie.org/docs/DexieErrors/Dexie.ConstraintError
|
|
858
858
|
Constraint: "ConstraintError";
|
|
859
|
-
//
|
|
859
|
+
// https://dexie.org/docs/DexieErrors/Dexie.DataError
|
|
860
860
|
Data: "DataError";
|
|
861
|
-
//
|
|
861
|
+
// https://dexie.org/docs/DexieErrors/Dexie.TransactionInactiveError
|
|
862
862
|
TransactionInactive: "TransactionInactiveError";
|
|
863
|
-
//
|
|
863
|
+
// https://dexie.org/docs/DexieErrors/Dexie.ReadOnlyError
|
|
864
864
|
ReadOnly: "ReadOnlyError";
|
|
865
|
-
//
|
|
865
|
+
// https://dexie.org/docs/DexieErrors/Dexie.VersionError
|
|
866
866
|
Version: "VersionError";
|
|
867
|
-
//
|
|
867
|
+
// https://dexie.org/docs/DexieErrors/Dexie.NotFoundError
|
|
868
868
|
NotFound: "NotFoundError";
|
|
869
|
-
//
|
|
869
|
+
// https://dexie.org/docs/DexieErrors/Dexie.InvalidStateError
|
|
870
870
|
InvalidState: "InvalidStateError";
|
|
871
|
-
//
|
|
871
|
+
// https://dexie.org/docs/DexieErrors/Dexie.InvalidAccessError
|
|
872
872
|
InvalidAccess: "InvalidAccessError";
|
|
873
|
-
//
|
|
873
|
+
// https://dexie.org/docs/DexieErrors/Dexie.AbortError
|
|
874
874
|
Abort: "AbortError";
|
|
875
|
-
//
|
|
875
|
+
// https://dexie.org/docs/DexieErrors/Dexie.TimeoutError
|
|
876
876
|
Timeout: "TimeoutError";
|
|
877
|
-
//
|
|
877
|
+
// https://dexie.org/docs/DexieErrors/Dexie.QuotaExceededError
|
|
878
878
|
QuotaExceeded: "QuotaExceededError";
|
|
879
|
-
//
|
|
879
|
+
// https://dexie.org/docs/DexieErrors/Dexie.DataCloneError
|
|
880
880
|
DataClone: "DataCloneError";
|
|
881
881
|
};
|
|
882
882
|
/** ModifyError
|
|
883
883
|
*
|
|
884
|
-
*
|
|
884
|
+
* https://dexie.org/docs/DexieErrors/Dexie.ModifyError
|
|
885
885
|
*/
|
|
886
886
|
export interface ModifyError extends DexieError {
|
|
887
887
|
failures: Array<any>;
|
|
@@ -890,7 +890,7 @@ export interface ModifyError extends DexieError {
|
|
|
890
890
|
}
|
|
891
891
|
/** BulkError
|
|
892
892
|
*
|
|
893
|
-
*
|
|
893
|
+
* https://dexie.org/docs/DexieErrors/Dexie.BulkError
|
|
894
894
|
*/
|
|
895
895
|
export interface BulkError extends DexieError {
|
|
896
896
|
failures: Error[];
|
package/dist/dexie.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*
|
|
5
5
|
* By David Fahlander, david.fahlander@gmail.com
|
|
6
6
|
*
|
|
7
|
-
* Version 3.2.
|
|
7
|
+
* Version 3.2.1-beta.1, Fri Nov 19 2021
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* https://dexie.org
|
|
10
10
|
*
|
|
11
11
|
* Apache License Version 2.0, January 2004, http://www.apache.org/licenses/
|
|
12
12
|
*/
|
|
@@ -1266,8 +1266,14 @@
|
|
|
1266
1266
|
var trans = db._createTransaction(mode, storeNames, db._dbSchema);
|
|
1267
1267
|
try {
|
|
1268
1268
|
trans.create();
|
|
1269
|
+
db._state.PR1398_maxLoop = 3;
|
|
1269
1270
|
}
|
|
1270
1271
|
catch (ex) {
|
|
1272
|
+
if (ex.name === errnames.InvalidState && db.isOpen() && --db._state.PR1398_maxLoop > 0) {
|
|
1273
|
+
console.warn('Dexie: Need to reopen db');
|
|
1274
|
+
db._close();
|
|
1275
|
+
return db.open().then(function () { return tempTransaction(db, mode, storeNames, fn); });
|
|
1276
|
+
}
|
|
1271
1277
|
return rejection(ex);
|
|
1272
1278
|
}
|
|
1273
1279
|
return trans._promise(mode, function (resolve, reject) {
|
|
@@ -1281,7 +1287,7 @@
|
|
|
1281
1287
|
}
|
|
1282
1288
|
}
|
|
1283
1289
|
|
|
1284
|
-
var DEXIE_VERSION = '3.2.
|
|
1290
|
+
var DEXIE_VERSION = '3.2.1-beta.1';
|
|
1285
1291
|
var maxString = String.fromCharCode(65535);
|
|
1286
1292
|
var minKey = -Infinity;
|
|
1287
1293
|
var INVALID_KEY_ARGUMENT = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.";
|
|
@@ -3857,7 +3863,18 @@
|
|
|
3857
3863
|
trans.idbtrans = parentTransaction.idbtrans;
|
|
3858
3864
|
}
|
|
3859
3865
|
else {
|
|
3860
|
-
|
|
3866
|
+
try {
|
|
3867
|
+
trans.create();
|
|
3868
|
+
db._state.PR1398_maxLoop = 3;
|
|
3869
|
+
}
|
|
3870
|
+
catch (ex) {
|
|
3871
|
+
if (ex.name === errnames.InvalidState && db.isOpen() && --db._state.PR1398_maxLoop > 0) {
|
|
3872
|
+
console.warn('Dexie: Need to reopen db');
|
|
3873
|
+
db._close();
|
|
3874
|
+
return db.open().then(function () { return enterTransactionScope(db, mode, storeNames, null, scopeFunc); });
|
|
3875
|
+
}
|
|
3876
|
+
return rejection(ex);
|
|
3877
|
+
}
|
|
3861
3878
|
}
|
|
3862
3879
|
var scopeFuncIsAsync = isAsyncFunction(scopeFunc);
|
|
3863
3880
|
if (scopeFuncIsAsync) {
|
|
@@ -4589,7 +4606,8 @@
|
|
|
4589
4606
|
dbReadyPromise: null,
|
|
4590
4607
|
cancelOpen: nop,
|
|
4591
4608
|
openCanceller: null,
|
|
4592
|
-
autoSchema: true
|
|
4609
|
+
autoSchema: true,
|
|
4610
|
+
PR1398_maxLoop: 3
|
|
4593
4611
|
};
|
|
4594
4612
|
state.dbReadyPromise = new DexiePromise(function (resolve) {
|
|
4595
4613
|
state.dbReadyResolve = resolve;
|