You can run a SQL script to create your database schema and relationships or joins through the browser, without having to log into the shell on the ThoughtSpot instance. You can edit the script and run it directly in the browser to create the schema. Note that you must have the can manage data permission and admin privileges to upload schemas. Use this feature for the following actions:
- Create the SQL script ahead of time, and use the browser to run it.
- Use the Write TQL interface to type your SQL directly into the browser.
- Use the Write TQL interface as an interactive SQL editor, to make changes to an existing schema.
Run or edit an existing script
To run or edit a SQL script that you already wrote to create your database schema and relationships through the browser, follow these steps.
-
Log in to ThoughtSpot from a browser.
-
Click Data, on the top navigation bar.
-
Click the ellipsis icon , and select Upload schema.
-
Drag and drop your SQL script into the browser, or choose Browse Your Files to locate it. You cannot copy and paste an existing SQL script into the SQL editor.
-
After you upload your SQL script, you enter the SQL editor. Use it to view your script and make any changes.
-
To edit the script, click on the line you would like to change, and type your changes into the interface.
-
When ready, run your script by clicking the Execute button.
-
If there are any errors, correct them and run the script again.
Write a new SQL script
To write a new SQL script to create your database schema and relationships through the browser, follow these steps.
-
Log in to ThoughtSpot from a browser.
-
Click Data, on the top navigation bar.
-
Click the ellipsis icon , and select Upload schema.
-
Select the Write TQL button in the top right corner of the screen.
-
After you select Write TQL, you enter the SQL editor. You can write your script for schema and relationship creation in this editor.
Note: You cannot copy and paste an existing SQL script into the SQL editor.When you finish writing a line, click the + icon to insert a new line below.
-
When ready, run your script by clicking the Execute button.
-
If there are any errors, correct them and run the script again.