Tableland 🛠 An Introduction to Tableland Studio

ETHOnline 2023 · 10 Oct 2023 · 7:36

The Tableland team gives a short, hands-on tour of Tableland Studio, a web app for creating projects and deploying tables. The walkthrough covers connecting a wallet and signing in, creating a team and project, defining a table blueprint with columns and constraints, and deploying it to a chain. It then imports a table created with the Tableland CLI and shows how to share a project link, which is handy for hackathon submissions.

Topics

From ETHOnline 2023, hosted by ETHGlobal.

Transcript

Hey everyone, this is the Tableland team and we'll be walking through the Tableland studio web application. So, the studio makes it easy to manage projects and deploy tables within a web UI. We also have a studio CLI that we'll walk through at a later period of time, but today we'll just go through that that UI workflow. And basically what we'll do is log in and connect with a wallet, we'll create a team, create a table, import a table, and show you basically just how to use that studio UI.

We'll also briefly divert into the Tableland CLI, but you can use SDKs or smart contracts to create tables and we'll walk through what the import workflow looks like. For example, if you already have some table that you've created, you want it to be in your project and managed within the studio app, you can import that data accordingly. So, basically this just allows you to create, deploy tables, and manage projects via a a nice concise UI. So, start by visiting the studio application that's studio.tableland.xyz.

And in the top right corner, we'll start by connecting our wallet. So, we'll go through that workflow with our wallet connection. And once we've connected, you can see the address that we're using is populated in the top right. We'll then go ahead and sign in. So, the sign in workflow then leads to creating an actual username and an email address associated with that username. So, it allows you to log into the app time and time again just to have those projects all associated with your username. And by default you'll see that your username will appear in the top left corner as the unique team identifier.

But if you'd like, you know, you can always create more than one team as needed. And right now, teams are just a single user, but we'll be extending that functionality to multi-users in the future. So, let's create a new project. We'll just call it starter. And then attach a description of what this project is. So, this will create the top-level framework for managing all the tables within a single project. So, we create this project, and then the first thing we'll do is start by creating and deploying a table within the studio.

So, you can see the blueprint section is This is basically where we'll start. You establish table definitions by creating a new table. And the first one we'll create, we'll just call it users, and it'll be pretty simple. It's just a users table, and it'll track maybe a an ID and a value for what that username is. So, we we name the table, we define a description, and now we select the columns and constraints for our table. So, we have that ID integer primary key.

We have a value web as a text type, and make sure that's not null. And now you see the actual create table statement that will be happening under the hood once we actually deploy the table. So, you can see that's that SQL statement that will be executed later. If we click on this table blueprint, we can see all that information we just set up. So, you have the description. It's a table that tracks users. You have the columns and constraints. You have ID and value with uh the primary key and not null associations. And then once we actually go ahead and the table, you'll see that deployment section

populate with additional information. So, let's go back to our home page for this project. We'll click on the deployments tab. And the deployments tab lets you basically, like once you have those blueprints, now you have the choice of where you want those tables to exist. And that red icon means that it hasn't been deployed yet. So, we'll click on it and select the chain that we want to deploy to. In this case, we'll just be using local Tableland, so local node for demonstration purposes.

Once you click deploy, you should get a a wallet pop-up. All Tableland creates and writes require gas fees, so we'll create a table. It'll go through the flow. We sign it, transaction completed. Waiting for it to complete. Okay, we're good to go. And now we have metadata for this users table. So, we have the chain that it was deployed on. Again, in this case, it was just local Tableland, but it could be any mainnet or testnet network. We have the unique Tableland name with the prefix, the chain ID, and the table ID, also known as the token ID.

And then just some other information like the transaction hash and block number. If there is table data existing, it'll it'll populate that bottom section, but we don't have any information written there yet. Cool. So, now back in that blueprint screen, we can see the table was deployed. And now let's walk through a flow where we import an existing table. So, this is something that maybe you created with the SDK smart contracts. We're going to use just the standard Tableland CLI, that's the @tableland/cli npm package.

We're going to run the Tableland shell command. This will open up a shell where you can just write raw SQL statements. So, here we're writing that create table statement. We're going to create a table called messages with an ID and a message column. Similar to the users table, this is pretty simple. And we'll deploy that table. So, once that table has been created, you'll see the unique table name, so that prefix, chain ID, and table ID. We'll need this in a second, so remember those numbers.

So, now back in the studio user interface, we'll input that chain ID 31337, table ID 14, and our table name was messages. And also, attach a description for this table. And note that when we created that table in the CLI, it was the same address that we used for when we logged into the studio. So, same account creating the same tables, and that's what allows us to import it seamlessly within our project. And since it was already deployed, already created, you can see that it already has that deployed association with it, as well as all that information that we just inputted into the CLI.

The last piece, and this is useful especially for hackathons or if you're just like sharing information about your project, click that share button, and then you can have a a link that you can copy and send to who whomever you'd like. So, again, there right now we only have a single user interaction on a on a project, but that allows you to at least share information around your project for visibility purposes, and later we'll let other users interact with our project as well. So, that's a a summary of of Tableland Studio, and check out more at tableland.xyz or our doc site as well.

Related talks