dataform icon indicating copy to clipboard operation
dataform copied to clipboard

Read table description from external files

Open mokshasoul opened this issue 10 months ago • 1 comments

Hi I posted in a wrong thread, but it would be great if there would be some support of sourcing external files for table descriptions (preferably makrdown).

This would enable us to have renderable + re-usable table descriptions across the repository the same way that dbt does it as well as make the sqlx file themselves smaller

mokshasoul avatar Apr 30 '24 17:04 mokshasoul

I suspect this wouldn't be too hard to implement:

  • Add a .md file reader to the compiler https://github.com/dataform-co/dataform/blob/2531b120c3869dbbc6efb4ecafbcfa9edb99c738/core/compilers.ts#L21
  • Expose a new JS method, like getContents("file.md") in the session https://github.com/dataform-co/dataform/blob/main/core/session.ts
  • Attach it to the global session, similar to how we do current attaching https://github.com/dataform-co/dataform/blob/2531b120c3869dbbc6efb4ecafbcfa9edb99c738/core/main.ts#L77

Ekrekr avatar Aug 16 '24 11:08 Ekrekr