<commit_before>import Dexie from 'dexie'

const db = new Dexie('btcr')
db.version(1).stores({
  sentRequests: '_id, receiverDid, verified, nonce',
  receivedRequests: '_id, senderDid, verified, nonce',
  did: 'txId1',
  wallet: '++id',
  claims: '++_id, subject, signed'
})

window.db = db

window.cleardb = () => {
  db.sentRequests.clear()
  db.receivedRequests.clear()
  db.did.clear()
  db.wallet.clear()
}

window.safeClear = () => {
  db.sentRequests.clear()
  db.receivedRequests.clear()
  db.claims.clear()
}
window.showDb = () => {
  db.sentRequests.toArray().then(a => console.log('sentRequests: \n', a))
  db.receivedRequests.toArray().then(a => console.log('receivedRequests: \n', a))
  db.did.toArray().then(a => console.log('did: \n', a))
  db.wallet.toArray().then(a => console.log('wallet : \n', a))
  db.claims.toArray().then(a => console.log('claims : \n', a))
}

export default db<commit_msg>Add a test db<commit_after>import Dexie from 'dexie'

const db = new Dexie('btcr')

db.version(1).stores({
  sentRequests: '_id, receiverDid, verified, nonce',
  receivedRequests: '_id, senderDid, verified, nonce',
  did: 'txId1',
  wallet: '++id',
  claims: '++_id, subject, signed'
})

window.db = db

const db2 = new Dexie('test')

db2.version(1).stores({
  test: '_id, *nonce'
})

window.db2 = db2

window.cleardb = () => {
  db.sentRequests.clear()
  db.receivedRequests.clear()
  db.did.clear()
  db.wallet.clear()
}

window.safeClear = () => {
  db.sentRequests.clear()
  db.receivedRequests.clear()
  db.claims.clear()
}

window.showDb = () => {
  db.sentRequests.toArray().then(a => console.log('sentRequests: \n', a))
  db.receivedRequests.toArray().then(a => console.log('receivedRequests: \n', a))
  db.did.toArray().then(a => console.log('did: \n', a))
  db.wallet.toArray().then(a => console.log('wallet : \n', a))
  db.claims.toArray().then(a => console.log('claims : \n', a))
}

export default db
{'fraction_non_alphanumeric': 0.2059282371294852, 'fraction_numerical': 0.0046801872074883, 'mean_word_length': 4.2425068119891005, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1114268', 'n_tokens_mistral': 739, 'n_tokens_neox': 747, 'n_words': 136}