Enable editing of schemas through the UI

Overview

There are several places in the Flow UI where you can directly create or edit schemas. For example, when connect a database table.

To support editing of schemas through the Flow UI, the schema server must be configured with a local taxi project, and then have editing enabled. This guide shows you how to achieve that.

When the Flow schema server is started, it reads the configuration from a config file. This configuration includes a list of repositories which the schema server will monitor. In this topic, we’ll explore adding a repository which can accept edits from the Flow UI.

This topic assumes you already have a taxi project that you want to make editable. If not, you might want to follow our instructions on creating a new taxi project first.

Add our taxi project to the Schema Server

We now need to add a new repository that contains our Taxi project. Flow supports multiple different ways of consuming Taxi projects. However, currently the only repository that supports editing through the UI is the Local file project.

Find your schema-server config file

By default, the Schema Server is configured by a file called repositories.conf in the directory where you launched the Schema Server from.

You may have overridden this when you launched the Schema Server, by specifying --flow.repositories.config-file=....

Find and open the schema-server config file in your editor of choice.

Specify a new file-based repository

Edit the config file, to add a new file repository.

We need to add the path to our newly created taxi project into our config file.

Ensure you add the path to the directory that contains the taxi.conf file you just created, but not the taxi.conf itself * Correct: /path/to/directory * Incorrect: /path/to/directory/taxi.conf
  • If there’s already a file {} block in your config file, add your path to the paths block, on a new line.

  • If not, copy and paste the below section into your config file, setting the path to the desired one:

file {
   paths=[
      "/path/to/project"
   ]
}

Make the file repository editable from the UI

Still in the config file, we need to add one more line, which tells the schema server that any edits are to be written to our project.

The schema server only supports writing edits to a single repository.

Modify the config file, adding a apiEditorProjectPath: "path/to/project" entry, with the same directory you just entered.

file {
   paths=[
      "/path/to/project"
   ]
   apiEditorProjectPath: "path/to/project"
}

Now restart the schema server.

Conclusion

The schema server has now been configured to accept edits via its API. Flow will detect this, and allow edits to be made within the UI, ultimately ending up with files created in our taxi project.