Closed mapner closed 11 years ago
I think that it would better to use Firebird's ROWS
DOCs directive instead of SKIP
and OFFSET
as it fits better with the way Idiorm is generating queries. It would mean that you don't need to change _build_select()
or _build_select_start()
.
Plus the Firebird manual describes ROWS
as a better alternative.
count()
can just be changed for all DB types to use an alias of row_count
or something else innocuous to prevent a Firebird specialist hack in that part of the code. Isn't the alias being escaped by the character in _detect_identifier_quote_character()
anyway? In which case this should not be needed at all.
Do you have any thoughts about those changes or know of any reasons it won't work?
I have committed my amended version of this path in commit bc0832e on the develop branch. Please could you try it out (paying particular attention to the count()
, limit()
and offset()
methods).
Ensure you download Idiorm from the develop branch: https://github.com/j4mie/idiorm/tree/develop
Hi,
The changes you proposed work ok only in Firebird version >= 2.1
I use 'FIRST' 'SKIP' and 'COUNT' alias to maintain code of legacy firebird version (1.5.6) and are compatible with new versions.
I have just taken a look and:
ROWS
was added in version 2.0 and not 2.1 according to the documentationTherefore I consider this feature to have been available and stable for long enough to implement it in preference to the SKIP
/FIRST
method, which appears to now be deprecated from what I can see in the Firebird documentation.
I maybe wrong, but based on this it would seem unlikely that anyone would be running servers prior to version 2.0 of Firebird so I would rather keep Idiorm cleaner and not cater to Firebird 1.0.
A similar compromise was reached with a similar ticket relating to PostgreSQL: https://github.com/j4mie/idiorm/pull/62
You're right. Is V 2.0 and the V. 1.5.6 is depreciated but I have clients that still use it!(dont ask why) But I understand follow the most stable version.
OK fair enough. I think you will need to keep a custom fork for that functionality though I am afraid. Thank you for your code though :)
STOP SPAMMING WITH PAID LINKS [edited by @treffynnon]
Hi,
I've adapted Idiorm for Firebird (www.firebirdsql.org).