TimescaleDB is an open-source relational database with support for time-series data. Fully managed and self‑hosted, it is built on top of Postgres.
In this tutorial, we will learn how to connect to TimescaleDB instances hosted on Timescale Cloud with Arctype.
To complete this tutorial, you will need the following:
Log in into your Timescale Cloud account. From your dashboard, click on create service to create a new TimescaleDB instance. This will pop up a page as shown below:
Click on create database. This will create a new TimescaleDB instance and load a page that contains the database information. Under service information, copy and save the database password:
After saving the database password, click on services from the left side menu and then select the new database. This will load the database dashboard, which contains all the information needed to connect the database with arctype as shown below:
Now that we have successfully created the TimescaleDB instance, let us connect it with our Arctype workspace. To do this is pretty simple and straightforward by following the steps below.
Login to your Arctype account and click on get started. This will load a page where a new connection can be added to your Arctype workspace. The next step is to select the Postgres connection type, since TimescaleDB is largely compatible with Postgres.
After selecting Postgres connections, fill in the connection credentials in Arctype with the credentials as shown on your TimescaleDB dashboard under Overview.
Click on test connection when you're done. You should get a notification showing connection successful. Then click on save.
After the connection has been saved successfully, this will take you to the workspace shown below:
Now that the database has been connected to our Arctype workspace, let's perform some operations on the database, like creating a new table using SQL.
In your Arctype workspace, click on new query and then enter the following SQL code:
CREATE TABLE `books` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `BookTitle` varchar(255) DEFAULT NULL, `Description` varchar(255) DEFAULT NULL, `Category` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
Click on run to execute the query. Once the query is successful, a new table with the name books will be added to the database.
In this tutorial, we learned how to create a TimescaleDB and how to connect the database to Arctype for effective management. We were also able to create our first table in the database using a query from our Arctype workspace.
If you are new to Arctype, you can read more about it in the Arctype documentation for additional information that you will need in using this powerful tool.