Skip to content

Commit

Permalink
docs: add a description about the couchdb lambda view (#1418)
Browse files Browse the repository at this point in the history
* docs: add a description about the couchdb lambda view

* Update content/en/apps/guides/data/analytics/building-dbt-models.md

Co-authored-by: Andra Blaj <andra@medic.org>

---------

Co-authored-by: Andra Blaj <andra@medic.org>
  • Loading branch information
njuguna-n and andrablaj committed Jun 6, 2024
1 parent 761a2a4 commit 1d1dccb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions content/en/apps/guides/data/analytics/building-dbt-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ This table can be used to get any field from a CouchDB document; however, it is
|`type`|The general type of the document, see below|
|`doc`| JSON of the source document|

### `couchdb_lambda_view`
This is a [lambda view](https://discourse.getdbt.com/t/how-to-create-near-real-time-models-with-just-dbt-sql/1457) with the same structure as the `couchdb` table. It contains the latest data coming in from CouchDB, and is useful for near-real-time data. However, to take full advantage of it, all downstream models built on top of it need to be views. This comes with a few drawbacks, such as not being able to index columns and performance issues when building views on top of views.

### `data_record`
All form responses are stored in the `data_record` table; see more details [in the database schema conventions]({{< ref "core/overview/db-schema#reports" >}}).
This table contains columns for the contact who made the report, the parent of that contact, the report data, and a copy of fields in `jsonb` format.
Expand Down

0 comments on commit 1d1dccb

Please sign in to comment.