Parameter is wrong order with Firebird adapter

I am writing a Firebird adapter.

For example, in PostgreSQL, the following SQL statement is generated when :limit and :offset are specified.

select a, b from c limit LIMIT_VALUE offset OFFSET_VALUE

In Firebird, limit and offset do not exist, so I would like to do the following.

select top LIMIT_VALUE skip OFFSET_VALUE a, b from c

However, the parameters are in the wrong order.

This is because the order in which arguments are expanded is fixed, independent of the adapter.

It would be good if the value of exprs could be changed for each adapter.

It would be possible to get the value corresponding to @all_exprs from an adapter function rather than an attribute in query/planner.ex, so that it works correctly in Firebird.

But, can this be solved by just modifying the adapter, without modifying the Ecto source code?

1 Like