A lot of clean up of code.
This commit is contained in:
57
app/js/app_idb.js
Normal file
57
app/js/app_idb.js
Normal file
@@ -0,0 +1,57 @@
|
||||
async function load_idb_tables() {
|
||||
console.log('****************** Load IDB Tables ******************');
|
||||
console.log('Loading IDB tables...');
|
||||
|
||||
localforage.config({
|
||||
driver: localforage.INDEXEDDB,
|
||||
version: 1,
|
||||
name: idb_name
|
||||
});
|
||||
|
||||
tbl_event = await localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event',
|
||||
});
|
||||
console.log('tbl_event count: '+ await tbl_event.length());
|
||||
tbl_event_key_count = await tbl_event.length();
|
||||
|
||||
tbl_event_location = await localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_location',
|
||||
});
|
||||
console.log('tbl_event_location count: '+ await tbl_event_location.length());
|
||||
tbl_event_location_key_count = await tbl_event_location.length();
|
||||
|
||||
tbl_event_session = await localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_session',
|
||||
});
|
||||
console.log('tbl_event_session count: '+ await tbl_event_session.length());
|
||||
tbl_event_session_key_count = await tbl_event_session.length();
|
||||
|
||||
tbl_event_presentation = await localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_presentation',
|
||||
});
|
||||
console.log('tbl_event_presentation count: '+ await tbl_event_presentation.length());
|
||||
tbl_event_presentation_key_count = await tbl_event_presentation.length();
|
||||
|
||||
tbl_event_presenter = await localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_presenter',
|
||||
});
|
||||
console.log('tbl_event_presenter count: '+ await tbl_event_presenter.length());
|
||||
tbl_event_presenter_key_count = await tbl_event_presenter.length();
|
||||
|
||||
|
||||
tbl_event_file = await localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_file',
|
||||
});
|
||||
console.log('tbl_event_file count: '+ await tbl_event_file.length());
|
||||
tbl_event_file_key_count = await tbl_event_file.length();
|
||||
|
||||
console.log('IDB tables have now been opened.');
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user