dbsrgits / sql-translator

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

Support Expressions as index fields #159

Open rabbiveesh opened 1 year ago

rabbiveesh commented 1 year ago
          @rabbiveesh As you design that, an interesting unit test for postgres to really test the boundaries would be
create table test (name varchar(50) not null);
create index ix_test2 on test (substr(name, 2, 3) desc, substr(name, 5, 3) asc);

:-)

Originally posted by @nrdvana in https://github.com/dbsrgits/sql-translator/issues/68#issuecomment-1601575733

There are a few more comments in that PR's discussion. (will past them back here).

Another thought - when parsing the fields, sqlt helpfully splits strings on commas. So we're actually going to have to only support that via a hashref arg (as mentioned there)

ref https://github.com/dbsrgits/sql-translator/pull/68#issuecomment-1601619597 and https://github.com/dbsrgits/sql-translator/pull/68#issuecomment-1601603518