QxEntityEditor - SQLite views

Forum for posting problems using QxEntityEditor

QxEntityEditor - SQLite views

Postby mdw » Fri Dec 01, 2017 12:44 pm

My SQLite DB contains a more complex recursive view:
Code: Select all
CREATE VIEW [vwGroupBibs] AS
WITH RECURSIVE
    [tab] AS(
        SELECT [BibFrom],
               [BibTo],
               [idGroup]
        FROM   [GroupBibs]
        UNION ALL
        SELECT [BibFrom] + 1,
               [BibTo],
               [idGroup]
        FROM   [tab]
        WHERE  [BibFrom] < [BibTo]
    )
SELECT DISTINCT [idGroup] AS [idGroup],
       [BibFrom] AS [BibNumber]
FROM   [tab];


When I try to import the schema of the DB containing this view, the action is quitted with the following error message (attachment). If I drop the view, everything is fine. I use QxEntityEditor release 1.1.9.
Attachments
Capture.PNG
Capture.PNG (48.33 KiB) Viewed 42976 times
mdw
 
Posts: 34
Joined: Mon Feb 15, 2016 2:45 pm

Re: QxEntityEditor - SQLite views

Postby qxorm » Fri Dec 01, 2017 3:28 pm

Hello,

I use QxEntityEditor release 1.1.9.

Did you try with latest version (QxEntityEditor 1.2.2) ?
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: QxEntityEditor - SQLite views

Postby mdw » Mon Dec 04, 2017 10:07 am

It does not work yet (QxEntityEditor 1.2.2 portable).
Attachments
Capture.PNG
Capture.PNG (7.88 KiB) Viewed 42972 times
mdw
 
Posts: 34
Joined: Mon Feb 15, 2016 2:45 pm

Re: QxEntityEditor - SQLite views

Postby qxorm » Mon Dec 04, 2017 11:35 am

I think the problem is that QxEntityEditor is based on Qt 5.1.1 which embed SQLite 3.7.17.
And it seems that recursive query and WITH keyword are available only with SQLite version 3.8.3 or higher : https://stackoverflow.com/questions/745 ... on-sqlite3
Sorry there is no plan to upgrade Qt version for QxEntityEditor for now.
And I don't know if there is a workaround in SQLite.
I would recommand to create your entity (based on this view) manually.
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: QxEntityEditor - SQLite views

Postby mdw » Tue Dec 05, 2017 8:20 am

We have found the following workaround: we maintain a copy of the SQLite DB without the special recursive view to generate the QxOrm entities in QxEntityEditor. It works, but obviously now we need to maintain two different template DBs.
mdw
 
Posts: 34
Joined: Mon Feb 15, 2016 2:45 pm

Re: QxEntityEditor - SQLite views

Postby qxorm » Tue Dec 05, 2017 12:56 pm

Maybe you could try something like this :
- in the ./sqldrivers/ directory of your QxEntityEditor package : you could try to update the qsqlite.dll file.

Because all Qt5 versions should be binary compatible, it could work (QxEntityEditor is built with MSVC2012 on Windows).

For example : if you are using QxEntityEditor for Windows 64bits version, just download latest Qt5 64bits versions. Then copy the qsqlite.dll file from the downloaded Qt5 package to ./sqldrivers/ QxEntityEditor package (for example, for Qt 5.9, SQLite is in version 3.16.1 ==> so recursive view and WITH keyword are available).
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am


Return to QxEntityEditor - Help

Who is online

Users browsing this forum: No registered users and 3 guests

cron