function onOpen() {
UI.createMenu('🔥 SQLite')
.addItem('❓ Help', 'showHelp')
- .addItem('Download SQLite database', 'showDatabaseDownloadDialog')
+ .addItem('🟢 Open sidebar', 'openSidebar')
.addItem('Upload to Backblaze', 'uploadToBackblaze')
.addToUi();
}
USAGE:
- Edit the data on this workbook like you would on any other Google Sheet, noting KEY ASSUMPTIONS below.
-- When ready, press the "Download SQLite database" button to generate and download a SQLite database from the workbook's data!
+- When ready, press the "Open sidebar" button to generate a SQLite database from the data on this workbook!
KEY ASSUMPTIONS:
- Each tab in this workbook is a data table
UI.alert('Help', helpMessage, UI.ButtonSet.OK);
}
+function openSidebar() {
+ const html = HtmlService.createHtmlOutputFromFile('query-to-db').setTitle('🔥 SQLite');
+ UI.showSidebar(html);
+}
+
// Helper function which will be called from the client-side dialog
function generateDatabaseQuery() {
const sheets = WORKBOOK.getSheets();
return query;
}
-function showDatabaseDownloadDialog() {
- const html = HtmlService.createHtmlOutputFromFile('query-to-db');
- UI.showModalDialog(html, 'Generating database...');
-}
-
function uploadToBackblaze() {
// b2_authorize_account
const credentials = `Basic ${Utilities.base64Encode(`${BACKBLAZE_ID}:${BACKBLAZE_KEY}`)}`;