Merge lp:~zorba-coders/zorba/zorba-for-sqlite into lp:zorba
Proposed by
Luis Rodriguez Gonzalez
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Chris Hillery | ||||
Approved revision: | 11143 | ||||
Merged at revision: | 11169 | ||||
Proposed branch: | lp:~zorba-coders/zorba/zorba-for-sqlite | ||||
Merge into: | lp:zorba | ||||
Diff against target: |
26 lines (+3/-0) 2 files modified
ChangeLog (+2/-0) modules/ExternalModules.conf (+1/-0) |
||||
To merge this branch: | bzr merge lp:~zorba-coders/zorba/zorba-for-sqlite | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matthias Brantner | Approve | ||
Rodolfo Ochoa | Approve | ||
Chris Hillery | Approve | ||
Review via email: mp+139108@code.launchpad.net |
Commit message
Add SQLite module.
Description of the change
Added sqlite module to ExternalModules
To post a comment you must log in.
I've pushed a couple changes to get the module compiling on Linux. However, several of the test cases fail for me with the error "http:// www.zorba- xquery. com/modules/ sqlite: SQLI9999 library routine called out of sequence".
I found this link regarding that error message:
http:// sqlite. org/cvstrac/ wiki?p= LibraryRoutineC alledOutOfSeque nce
However, I think the error may be in the test cases. You are using a number of "let" statements to perform sequential tasks such as opening the database connection and querying it, and as far as I know XQuery doesn't guarantee the order of operations of lets in a single FLWOR. Changing these to sequential blocks using scripting may solve these problems. For instance, test0.xq currently reads
let $path := f:path- to-native( resolve- uri("./ ")) concat( $path, "small2.db")) query($ db, "select * from smalltable")
let $db := s:connect(
let $isconn := s:is-connected($db)
let $result := s:execute-
let $old-db := s:disconnect($db)
return ($result, $isconn)
This throws the SQLI9999 error. However, if I change the query to the following:
let $path := f:path- to-native( resolve- uri("./ ")) concat( $path, "small2.db")) $db); query($ db, "select * from smalltable");
let $db := s:connect(
return {
variable $isconn := s:is-connected(
variable $result := s:execute-
variable $old-db := s:disconnect($db);
($result, $isconn)
}
the test passes. (Note that when running this query from the command line, I get "Zorba static warning [zwarn:ZWST0004]: sequential FLWOR expr may not have the semantics you expect", so perhaps my code isn't totally correct either. But the test passes, at least.