One of the things that I like about the Data API Builder (DAB) is that there is a lot of CLI work that can be done. However, lots of people don’t like these, so I’m glad there’s a series of extensions in the Visual Studio Code (VSCode) marketplace that you can use.
This post looks at the start and add extensions. Another post will look at the others.
Update: All these are now in one extension.
This is part of a series of posts on DAB that I’ve written. I also have articles at SQL Server Central about DAB.
Installing the Extensions
In VSCode, you can search for DAB in the extensions blade. You should see these, but there could be more by the time you read this.
I clicked install on these and they were added to my VS Code. Now let’s play with them. Each of them adds a right click menu item to the dab-config.json file.
DAB Start
The first one I tried was start. Since I had a valid dab-config.json in my file list, I could right click it. I see DAB Start as an option and select it.
This opens a new terminal. You need to be aware of this, as on the right side of your terminal, there is a new column and each terminal session is listed. The lower one is highlighted, opened by the DAB Start extension. You can see the output on the left, which is running.
I could then interact with my APIs in the browser. When I wanted to stop this, I could CTRL+C in the left terminal section, as in any, but I’d still have this terminal extension. The next time I clicked DAB Start, another new session would start.
Instead, I clicked the “Delete” trashcan next to the terminal on the left to stop this session and the DAB service.
DAB ADD
The ADD extension lets you add entites as well. If I right click and select DAB Add, I get another menu of types.
Once I select one, I see a list of objects from the database that I can view. In this case, the connection used in my DAB config file only sees three tables, so I can choose one of these.
If I hit Enter, I get a message that this was added.
If I look in the JSON for the config, I see that this is indeed added. This is another entity in my list, with the graphql and REST endpoints enabled.
Summary
This post looked at these simple extensions, which leverage VSCode to make working with the DAB easier. If you’re experimenting with DAB, try these extensions. I certainly find them easier ways to work with my config file than editing things directly or trying to copy/paste.