Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nolanlawson/38e3cd6705f50b074566 to your computer and use it in GitHub Desktop.
Save nolanlawson/38e3cd6705f50b074566 to your computer and use it in GitHub Desktop.
Test binary format in PouchDB using IndexedDB
<html>
<pre id="display"></pre>
<script src="//cdn.jsdelivr.net/pouchdb/latest/pouchdb.js"></script>
<script>
(function () {
'use strict';
var display = document.getElementById('display');
var db = new PouchDB('mydb');
db.info().then(function (info) {
display.innerHTML += 'Database info:\n' +
JSON.stringify(info, undefined, ' ') + '\n';
display.innerHTML += 'Are we using binary blobs? ' +
(db.adapter === 'websql' ? 'not applicable; this is WebSQL' : (info.idb_attachment_format === 'binary'));
})
})();
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment