dbsrgits / sql-translator

SQL::Translator (SQLFairy)
http://sqlfairy.sourceforge.net/
82 stars 91 forks source link

add support for covering index (INCLUDE) on PG producer #131

Closed rabbiveesh closed 3 years ago

rabbiveesh commented 3 years ago

This adds support for covering indices (i.e. the "INCLUDE" clause on create index) for the Postgres producer.

the intended interface is as follows

$table->add_index(
   name => 'covering', fields => [ 'foo' ], 
   options => { include => [ 'bar', 'baz' ] }
);

In the current implementation it silently skips the clause if PG is under version 10, b/c it was only added in 11 (as far as I remember). I'm not quite sure if it should be that way, or if it should die.

rabbiveesh commented 3 years ago

The only thing left here is to improve the docs with the updated index grammar.