Metadata Properties

Blocks support metadata, a map of data about the block. The metadata system allows for arbitrary annotation of data. It could be used by developers for many purposes, annotating data sources, transformations, policy etc.

Defining Metadata

Defining metadata on a block

#+src sql SalesPerCountry()
#+meta {
   :author "John Doe"


Adding Documentation to Blocks

Documentation could be added to the block by using :doc metadata key. This information then used by our automatic documentation generation system as well as it could be accessed from runtime by the user using builtin function.

#+src sql blockName(value)
#+meta {
      :doc "First line should be a summary of a block.
  Next lines should give more detailed description.
  Our tool will be using this convention to display documentation
  summary / full description when requested.
  All whitespaces at the beginning of the multi-line docstrings will be ignored. This could be used to indent lines according
  to your visual preferences. In this example we use two spaces indentation.

  Try to document all positional arguments, and wrap them with a backticks (`) so that editors and IDEs can identify
  them and potentially provide extra functionality.
  For example, given block accepts `value` argument which expected to be INTEGER."
  SELECT {{ value }}



Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request