dbml icon indicating copy to clipboard operation
dbml copied to clipboard

Add support for documenting partitioning and clustering columns

Open rileyschack opened this issue 3 years ago • 2 comments

BigQuery has support for partitioning and clustering columns, and this doesn't appear to be supported in DBML. Would it be possible to add support for these features? I'm thinking it could be implemented in a similar fashion to indexes (i.e. hover over the table name to see this information). Example usage:

Table table_a {
  id string
  created_at timestamp
  
  // table_a is partitioned on the created_at column with a granularity of hour
  partitions {
    created_at [granularity: "hour"]
  }
  
  // table_a is is also clustered on the id column
  clusters {
    id
  }
}

Table table_b {
  id integer
  created_at timestamp
  
  // table_b is partitioned on the id column where values 0-9 are in one partition, 10-19 are in another, etc
  partitions {
    id [start: 0, end: 100, interval: 10]
  }
}

rileyschack avatar Dec 28 '21 16:12 rileyschack

PostgreSQL also has this functionality and it would be nice to have a standard way to represent it in DBML.

duckontheweb avatar Aug 23 '22 15:08 duckontheweb

Wow... the ticket has been open for ~3 years now... might need to take a look at alternatives...

blackfyre avatar Apr 10 '24 19:04 blackfyre