Last active
August 29, 2015 14:15
-
-
Save nolanlawson/38e3cd6705f50b074566 to your computer and use it in GitHub Desktop.
Test binary format in PouchDB using IndexedDB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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