Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are a bunch of minor fixes or refactoring, testing, and doc improvements in this PR, but the main change in this PR is versioning of schemas. It is backwards-compatible, with the exception that now it will delete unused indexes by default (which I think should be fairly safe and fits in with the behavior that we auto-delete unused stores) and it will also destroy and rebuild stores if they are respecified with different options (e.g., a different
keyPath
). The README ought to be helpful in visualizing the newschemas
(andschemaBuilder
) formats.get
andcount
);newVersion
for PhantomJSclearUnusedIndexes
option (defaults totrue
);schemas
object keyed to version with valuesas
schema
objects. (Utilizes ownIdbImport
class, relying on own fork ofidb-schema
at least for now.);idb-schema callbacks will be passed db.js
Server
as second argumentschemaBuilder
callback which accepts anidb-schema object for incremental,
versioned schema building and whose
addCallback
method will bepassed an enhanced
upgradeneeded
event object with aServer
objectas a second argument for making db.js-style queries
(e.g., to modify store content), albeit with certain limitations.
Along with
schemas
, addresses issues Update/database migration #84/There is no way to test if the db.js is upgraded #109clearUnusedStores
property to conditionally avoid deleting old stores.db.del
alias ofdb.delete
del()
alias onServer
for parity withidb-batch
(likely to use or adapt for multiple change transactions);schemas
) to differentiate between "mixed", "whole", "idb-schema", and "merge" types withschemaType
option (defaulting tomixed
forschema
andwhole
forschemas
, maintaining prior behavior in backward-compatible manner);version
andschema
to takeschemaBuilder
into account(and document
schemaBuilder
).key
is optional toolimit
onmodify
const
where possible;lang
attribute for Atom linter-jade package;preventDefault
not only for Firefox.