holistics / dbml

Database Markup Language (DBML), designed to define and document database structures
https://dbml.org
Apache License 2.0
2.89k stars 170 forks source link

Support SORTKEY and DISTKEY (Redshift) #104

Open laurilli opened 4 years ago

laurilli commented 4 years ago

Hi! Not sure if this is possible already, but I haven't found a way to specify Redshift-type keys. A lot of our analytical data warehouses are hosted on Redshift so this would be useful. Have I missed this feature and/or is this something you are looking to integrate? Thanks! :)

nvquanghuy commented 4 years ago

Thanks for this @laurilli, indeed we currently don't support SORTKEY and DISTKEY since it's a dialect specific to Redshift, so introducing it directly to DBML will inflate it unnecessarily.

I suspect this will make more sense when we introduce concept of "dialect" to extend the language.

For example something like this:

[@Dialect='Redshift']
Table orders {
  user_id integer [distkey]
}