PlanetScale is no doubt one of the most revolutionary database platforms. It provides one of the best developer experience when it comes to deploying and managing MySQL databases. And it does so without compromising on performance, user experience, and feature set. The database branches and deploy request in PlanetScale provides a safe way to make schema changes in your MySQL Database. The web interface is intuitive, and if you need more control over your databases you also have a robust CLI that gives you more control over how you are managing your database. All of this with the ability to scale your database to handle millions of reads and writes.
What makes this possible is the underlying technology that is Vitess. Vitess is the engine that makes it possible to scale to this enormous scale. But it comes with some compromises, like not having Foreign-Key constraints. This brings some problems when you try to use your PlanetScale MySQL Database with some of the BI tools. At the moment no major BI tools(Metabase, Redash, Tableau, PowerBI) properly support PlanetScale, except Draxlr.
We are thrilled to announce that Draxlr now fully supports PlanetScale Databases, you can query, and visualize your PlanetScale MySQL Data on Draxlr to build Dashboard and Setup Slack and email alerts. Let’s see it in action.
Connect your database
Head out to https://app.draxlr.com/ and register yourself, once the registration is done you’ll be asked to choose a setup type. If you have your database credentials and know how your data is structured, you can click on the Manual option and if you think you’ll need assistance setting up your database you can click on the Assisted option and schedule a call with us. If you choose the Manual setup option, you will be taken to the add database page.
On the page above select the PlanetScale option, then enter your database credentials.
To get credentials of your Planetscale database, goto your Planetscale dashboard and the database your want to connect to Draxlr. Then hit the connect button on the top right, it’ll open a Modal with your database credentials. Then select General in the Connect with dropdown. Then you’ll have the credentials of your database. Except for the password, which you will have to generate each time you open this Modal.
Just fill it in on the Draxlr App and hit the Test Connection button. If the connection is successful the database will be automatically connected to Draxlr.
In a few seconds, you should see the tables page with the list of all the tables in your database. Click on any of the tables or hit the Explore button on the top right, which will take you right to the Explore Section of the Draxlr.
Explore is one of the two major sections of Draxlr(Dashboard being another one). In explore you can query your database to find the answers you are looking for and save them as Saved Queries. Currently, there are 2 ways to get those answers. Either you can dive into Raw SQL Queries or you can use our intuitive Query Builder, which lets you quickly find answers without writing a single line of code. Even if you can write Raw SQL queries the elegance of the query builder makes the process just simpler and easier.
Draxlr Provides a UI to filter, sort, and summarize your data. As you can see below the query builder has multiple operations and you can choose them to get to the answer you need from your database. You can apply a complex filter, and order data by a field or multiple fields. You can even summarize your data and group the results based on some metric. Once you have your answers you can save them as a Query. Which you can use later to build Dashboards and Setup Alerts.
Graphs and Charts
Once you have applied your filters and summarizations you can visualize your data in Graphs and Charts. Draxlr has powerful options to build charts. You can select from a set of supported Graph Options, You can select fields for each axis(multiple for the y-axis). You can add labels, and titles, and update orientation. In the case of grouped results, you can Group the results in different ways. Not just that you can also choose to Format your results in the graph a certain way(Precision, Currency, etc.). Once you have built your graphs, you can save or update them in your Query, which you can use later to build the Dashboard.
Although the Query builder provides quite a lot of options to get the answers you are looking for, there are times when you just want the Raw power of SQL Queries. To write SQL Queries you can switch to Raw Query mode in Draxlr. If you are already in the query builder you can hit the button above Execute that says Show Raw SQL Query. That will take you to the Raw Query mode with the Code editor. You will get the SQL for the Query that you have built using the Query Builder. You can update the query and see the results on the right side. If you want to start from scratch you can deselect the table you are on then hit the Raw SQL button above the table list. The Code Editor fully supports SQL, it can provide Code Highlight, Formatting, Download, and even Auto Completion. You can save the queries that you have created using the Raw Query editor as well to use later to for the dashboard and slack/email alerts.
Dashboard is another major section of the App. Once you have the answers you need and you have saved your queries, you can go ahead and start building your dashboard. Just head out to the dashboard section and hit Add button. It’ll open a modal that has a list of all your queries. You can select the query you want to add to the dashboard. Select the view(Table, Graph, or Computed Card), and the the refresh interval. Since these queries can be quite intensive, we only execute these and update the result on certain intervals. This makes sure your database is not overloaded. Though at any point you feel like you need the latest data, you can just go and refresh it manually. Once you have selected all the options you can click Add Dashboard Item. And it will add the item to the current dashboard.
Once the item is added you can move and resize it to customize your dashboard. Not just that you can create multiple dashboards for different use cases. And each dashboard can be shared with a different or same set of users. You can share your dashboard with a link(PIN Protected). Or you can embed it on your website or app. The embeds are domain protected. So that only the domains you allow can embed your dashboard.
Slack and Email Alerts
On Each dashboard item you have options to share and set up alerts. On the top right corner of each dashboard item there is a toggle to open a menu, which has all the options for a dashboard item. You can go ahead and click on Set Alerts. Clicking on it will open a modal that has all the alert options.
First, you have options to choose the places you want to receive alerts. You can select the emails you want to send the updates to. It can be users that are part of the organization or it can be users from outside the organization. Another option is via Slack Alerts. You can select a slack channel to get updates on your dashboard item. Keep in mind, to receive updates on a private slack channel you need to add Draxlr to that channel. If draxlr wasn’t previously added to the channel you can add it and refresh the list of channels on the modal(click on the refresh icon).
Second, you can select when you want to get updates. Here you again have two options, first you have option to get updates when any value is changed. So every time your dashboard item is refreshed, we check if the values are changed from the last time. If it has we send you an update. The other option is to receive the updates on specific days at a specific time. You can select the days of the week you want to get updates on and select the time of the day. In this case, you can get an update on the dashboard item on the selected days at that time.
You will received a screenshot of the dashboard item. In the case of the computed card without a target, you will receive the direct values. And in the case of a table, you will receive data in CSV format.
We are very thrilled to add the support for PlanetScale and are excited to see how you guys use it, to build your bi dashboards and set up Alerts. If you have any doubts or need help with anything you can schedule a free call with our team to learn more on this link.