@@ -5,6 +5,10 @@ and includes all features as described in the revIgniter User Guide
55(see chapter [ Database Library] ( https://revigniter.com/userGuide/database/index.html ) ).
66It is meant to be used with desktop and mobile apps.
77
8+ ### Requirements
9+
10+ LiveCode version 9 or higher
11+
812### How to use this library:
913
1014Place the library in the message path, then call the rigLoadDatabase
@@ -51,6 +55,31 @@ function and connect using the rigConnectDB handler like:
5155- ** tOptions** is a comma delimited list of SQLite options. It can
5256 be empty or can contain "binary", "extensions" or both.
5357
58+ ### How to convert a query result array to a datagrid array:
59+
60+ This library provides a handler which converts database query result arrays
61+ to datagrid arrays.
62+
63+ queryResultArrayToDgArray @pArray pFields
64+
65+ - ** pArray** is the database query result index named "resultarray"
66+ - ** pFields** is the database query result index "fieldnames" which
67+ contains the table field names in a numbered array
68+
69+ Here is an example:
70+
71+ # ALL QUERY DATA
72+ put rigDbGet("recipe") into tQuery
73+
74+ # THE QUERY RESULT ARRAY
75+ put tQuery["resultarray"] into tDataGridArray
76+
77+ # CONVERT RESULT ARRAY TO DATGRID ARRAY
78+ queryResultArrayToDgArray tDataGridArray, tQuery["fieldnames"]
79+
80+ # POPULATE DATAGRID
81+ set the dgData of grp "myDatagrid" to tDataGridArray
82+
5483### License
5584
5685For the license terms see the LICENSE file.
0 commit comments