Project

General

Profile

Actions

Feature #998

closed

Allow rows ? (to ?) sql clause in Query.C and Query_impl.h (not only offset and limit)

Added by Łukasz Matuszewski over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
09/23/2011
Due date:
% Done:

0%

Estimated time:

Description

I have changed a little class Query to allow processing of Firebird 2.1 (and up). The change is about to be limit and offset select statement.

In Firebird 2.1 (and up) you have to use ROWS statement like:

select * from mir_something rows 1 to 20

ROWS A TO B (where A > 0 and B > 0).

Typical change would be to allow Query to use ROWS instead limit and offset. For example simply add a method:

  void useROWSInSELECT(bool queryIsUsingROWS);

and then use SELECT with ROWS subclause if queryIsUsingROWS == true (otherwise use limit and offset).

Subclassing would be a little overhead.

BR,

Łukasz Matuszewski


Files

Query.C (4.82 KB) Query.C Łukasz Matuszewski, 09/23/2011 10:59 AM
Query_impl.h (11.9 KB) Query_impl.h Łukasz Matuszewski, 09/23/2011 10:59 AM
mir_firebird.cpp (23.2 KB) mir_firebird.cpp Łukasz Matuszewski, 09/23/2011 10:59 AM
Actions #1

Updated by Łukasz Matuszewski over 12 years ago

Actually mir_firebird.cpp should be a little modified to be purely using ibpp.h - which is a C library for Firebird (now it uses my wrapper DatabaseModule and its types (found somewhere else in this forum :)))

Actions #2

Updated by Koen Deforche over 12 years ago

  • Status changed from New to InProgress
  • Assignee set to Koen Deforche

Hey Lukasz,

It sounds that we should provide a dialect option to indicate how the (indeed non-SQL standard function of) offset and limit is supported ?

Do you have any plans for releasing and supporting the firebird sql connector, btw ?

Regards,

koen

Actions #3

Updated by Łukasz Matuszewski over 12 years ago

Do you have any plans for releasing and supporting the firebird sql connector, btw ?

Yes i have, but using ibpp Firebird library.

Yes a dialect option would be perfect (to switch between ROWS / LIMIT OFFSET subclause).

BR,

Lukasz Matuszewski

Actions #4

Updated by Koen Deforche over 12 years ago

  • Status changed from InProgress to Resolved
  • Target version set to 3.2.0

Hey Lukasz,

I've added this dialect option to SqlConnection, but haven't actually tested the "rows ? to ?" variant...

Pending a push to the git repository.

Regards,

koen

Actions #5

Updated by Koen Deforche over 12 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF