Report Layers

eye 0thumbs up 0thumbs down 0clock 20 June 2023

Administrative tool. Intended for users experienced in working with databases.

The Report Layers module (formerly called SQL Layers) allows you to add a Data Source to the System based on any view created in the System’s database datasources schema.

Can you put it in simpler terms?

Not everything can be (or is worth) configured by “clicking” in the Administration Panel. Sometimes a few lines of SQL can work wonders. For example, we have:

  1. Data source with GPZ Points
  2. Data source with National Parks
  3. Data source with parcels, to which multiple users add new parcels for potential investment.

Using the Report Layers module, we can add a Data Source to the system named Report PN + GPZ, which will include the following attributes:

  1. Parcel identifier,
  2. Distance to the nearest National Park,
  3. Name of that National Park,
  4. Distance to the nearest GPZ, and
  5. Name of that GPZ.

Layers created from Data Sources added through the Report Layers module are read-only.

How to do it?

  1. Obtain database access credentials (with administrative rights)
  2. Use a database management tool (PgAdmin, DBeaver) to connect to the database.
  3. Create a view in the “datasources” schema
  4. Go to the Administration Panel > Modules > SQL Data Sources.
  5. Select a source from the available list (only those from the “datasources” view are shown here)
  6. Save the data source under the chosen name
  7. The new data source is now available in the sources tab: you can use it as you wish

WARNING!

  1. The view must include an ID field
  2. Do not change the view schema configuration if it is being used as a data source. The source will stop working and will no longer be usable.

Was the article helpful?

Next article

Calendar heatmap