Description Transcript
In this video, we'll explore the Retool Database interface and show you two essential methods for getting your data set up quickly and efficiently.
Using Google Sheets as a database is holding back your development workflow.
Retool Database combines the familiar spreadsheet interface you love with the power of PostgreSQL underneath, giving you proper data validation, relationships, and scalability, without the complexity.
Whether you're migrating from spreadsheet workflows or looking for a builder-friendly database solution, this walkthrough will show you how to leverage PostgreSQL power with spreadsheet simplicity – perfect for builders who want database reliability without database complexity.
Key Topics Covered:
00:00 - Intro
00:15 - Retool DB Walkthrough
01:08 - Creating a Table
01:17 - Manual Table Creation
01:58 - Field Types + Foreign Key
02:16 - Benefits of a PostgreSQL table
03:21 - Generate Schema with AI
04:16 - Importing a CSV
05:11 - Editing Table
05:32 - Closing Remarks
Useful Resources:
Host: Angelik Laboy Torres, Developer Advocate @ Retool
Read more 0:03 Welcome, my name is Angelik Laboy Torres, I'm a developer advocate here at Retool and today 0:07 we'll be learning about Retool Database. 0:09 So I'll give you a walkthrough, you'll import some tables, we'll create some tables, so 0:14 let's get started. 0:17 So when we start out in our working space, we'll go to the navigational bar and click 0:22 on Database. 0:22 From there, it will open up a spreadsheet like editor that is made on Postgres SQL. 0:28 If you go over here in the style bar, you will see all of your tables. 0:31 And when you open them, it would actually have a tap at the top for quick access. 0:35 Now, if we go to the left bottom corner, Retool DB automatically creates separate 0:40 databases depending on which environment you're in. 0:43 So you have development, staging and production. 0:46 And when you click on here, you have the dropdown that allows you to switch back 0:49 and forth. Now in the center, you have the command center, and this has actions 0:54 like import Google Sheets and also schema migration 0:58 between the different environments that you have. 1:01 And then it also has the typical filter search 1:04 and it even does like column visibility as well as sorting. 1:09 Now let's dive in and create our first table. 1:12 I'll show you two ways, the Manic Creation 1:14 and the import CSV. 1:18 First, let's create a table from scratch. 1:19 So I'll go over here and I click on the sidebar, 1:22 new table and there I can write my name of my tools or products and from there I 1:27 can click on add column whenever I want to add something to the scheme. I have 1:31 first my ID which is actually my primary key. Every table needs a unique 1:36 identifier and most of the time it's an ID or whatever you assign it it doesn't 1:40 primarily have to be this. Just keep that in mind. Then I'm gonna add I'm gonna do 1:44 product name and that's when that's a text. Then I'm gonna do price and I need 1:49 that's a decimal. So number integer decimal. And then lastly, category. And that's fine 1:57 as a text. And you can see different field types in here, right? You have tags, number, 2:02 dates and boolean. And if you notice, you actually have foreign key. And the cool thing about 2:07 this is that it allows to create relationships between tables with one another and connects 2:11 them. But we'll talk about this in future videos. Now, unlike traditional spreadsheets, 2:16 database offers very powerful data validation features like data type, you also have the 2:22 nullable, you also have the unique constraint and the default value. So Postgres SQL's data type 2:28 enforcement automatically validate entries and it prevents users from entering letters when it's 2:34 supposed to be just numbers or for example in the price field or numbers in the product name. 2:40 It also gives the ability for unique constraints that prevent duplicate entries where they shouldn't 2:45 exist, such as ensuring that no two products have the same SKU code for when we're talking about 2:52 products. And then you have noble controls which determines whether a field can be left empty. 2:58 So for example, product name should not be empty because it should be a requirement, 3:02 but at description it can be empty. And yeah, so these features really create the guardrails for 3:08 maintaining data quality and ensuring inventory systems remain reliable. Unlike spreadsheets 3:14 that you can go in and change them whenever you want, wherever you want. 3:18 Right? So now that I'm done here, I actually see the generate schema with AI and I'll try it out. 3:24 So I click create, have this create over here and I'll click new table and go over. 3:31 And what you do is actually give it a prompt. So I'm going to do, I need a table for product info 3:40 and then enter see what happens 3:45 okay and i created stuff like the product name description price and even set up like what 3:50 type it would be and just like i can go in and actually modify like oh no i don't think that 3:55 would be a noble i need that to be true also i think price should be yeah that's the most fine 4:01 and this should be unique and yeah i can click create. Oh! No table name can be left empty my bad 4:08 I'm gonna do products, V2, and click create. 4:18 Now let me show you a faster way which is through importing CSVs. So I'll go over here in the create 4:23 new table and I go into import from CSV, double click or drag and drop and I have my expense 4:29 data. I'm actually going to link this down below for you guys to have access to it or if not you 4:33 you guys can bring your own data. 4:35 So I'll click here and we're now opening up 4:37 this schema mapping interface. 4:39 And it's basically asking the questions of 4:40 do the columns of my CSV match with what I want 4:43 out of my database. 4:44 And I can make any sort of corrections in here. 4:47 I'm like the merchant, I'm like, 4:50 maybe I want this to be an integer or anything else. 4:55 I'm like, you know, this is a float, this is all fine. 4:58 And then I can click over here. 5:00 I have Create a Primary Key or use a column. 5:04 If I disabled this, then it will create it for me. 5:07 Otherwise, I would just use my ID. 5:09 So Create Table and then, da da da da da, very fast. 5:13 And the cool thing is that it's not that it has to be 5:15 permanent, neither the primary key or the settings 5:17 that you have, so I can actually go over here, 5:20 go on Settings and then go, I don't want it to be a text. 5:23 To be honest, I want this to be an enum 5:25 and this all seems good to me, so I'm gonna save it. 5:28 And then it's very easy, very fast to interact with. 5:32 So thank you so much for watching. 5:33 This is the end of our video. 5:34 In this video, you were able to create, import, 5:37 and also just get a general walkthrough of RetoolDB. 5:41 If you want to connect with other buildings, 5:43 I actually invite you to go to our community forum 5:45 where you can talk to other people, 5:47 get your questions answered, 5:48 or just see in general what projects are being built. 5:51 For the next video, we're going to be tackling on 5:53 how to assemble your UI and how to best arrange components. 5:57 So stick around and thank you.