Setting up BG Database Locally
Configuring the Data Source for BG Database
Open BG Database
Open the BG database window by going to Window -> BG Database
Create a data source
The first thing we need to do is setup a data source for BG Database.
Open the ‘Import / Export’ tab
Navigate to the ‘Data Sources’ tab and click the ‘+’ button
This will open the window below. Choose ‘GoogleSheets’ from the drop down list and give your data source a name, for example “Metadata Service”, as shown below:
Configure Data Source
On the ‘Main’ tab of the data source, select ‘OAuth 2.0’ as the Datasource type, and populate the fields as specified in your Google Cloud OAuth Credentials setup.
Then click the ‘Get New Tokens’ button
This will open a Google Chrome tab that asks you to grant access to the application.
And then click ‘Allow’ on the second page:
Once this is completed, you can close the Chrome tab and return to the editor:
In the BG Database window you will see that the ‘Token’ and ‘Refresh Token’ fields are now populated and you will be prompted to ‘save’ the changes that you have made.
Note: These settings are LOCAL to your PC and NOT shared (pushed up to version control etc).
That’s it! You are now connected to the metadata service and can push / pull data from Google Sheets!
Importing Data from Google Sheets
Now that we have configured the data structure, importing / iterating on the data is much simpler.
Set up your Import Job
Step 1: Add a ‘Job’
Before we can import the data, we have to setup a ‘Job’ to do the import. This only needs to be done once.
Open BG database (Window -> BG Database)
Export / Import tab
Jobs tab
Click the ‘+’ button to add a new job. You will see a popup like below. Choose ‘Google Sheets’ from the list:
Give your Job a name and click ‘Add’
Step 2: Choose your data source
After you create your Job, it will tell you that a Datasource is not defined.
Click the '+' button and then simply Choose the Data source we created previously from the dropdown
Step 3: Configure Merge Settings
Next, BG Database will tell you that you haven’t specified how you want to merge the data (if required).
Switch to the “Merge Settings’ tab
And choose ‘Transfer’ from the dropdown
Note: This mode will overwrite any LOCAL changes to the database with whatever is on the Server.
BG Database ‘does’ support more complicated merge options, which will be covered in a later document. For now, lets' assume that we want to pull (from Google Sheets) all of the latest changes) for the remainder of this document.
Last updated