11# LiveCode SQLite library
22
3- This SQLite library is borrowed from revIgniter's database library
4- and includes all features as described in the revIgniter User Guide
5- (see chapter [ Database Library] ( https://revigniter.com/userGuide/database/index.html ) ).
6- It is meant to be used with desktop and mobile apps.
3+ This SQLite library is borrowed from revIgniter's database library
4+ and includes all features as described in the revIgniter User Guide
5+ (see chapter [ Database Library] ( https://revigniter.com/userGuide/database/index.html ) ).
6+ It is meant to be used with desktop and mobile apps.
77
88### Requirements
99
10- LiveCode version 9 or higher
10+ LiveCode version 9 or higher
1111
1212### How to use this library:
1313
14- Place the library in the message path, then call the rigLoadDatabase
15- function to connect to your database like:
14+ Place the library in the message path, then call the rigLoadDatabase
15+ function to connect to your database like:
1616
1717 get rigLoadDatabase(tParams, tReturn, tActiveGroup, tOptions)
1818
19- - ** tParams** can optionally be a path
20- to a database or an array of database settings like the settings
19+ - ** tParams** can optionally be a path
20+ to a database or an array of database settings like the settings
2121 in revIgniter's database.lc.
22- - ** tReturn** is an optional boolean which determines if the
23- database ID should be returned.
24- - ** tActiveGroup** is optional and is used to give the database
25- configuration group a name.
26- - ** tOptions** the optional fourth parameter is a comma delimited
27- list of SQLite options. It can be empty or can contain "binary",
28- "extensions" or both. Note: This parameter is needless if all
22+ - ** tReturn** is an optional boolean which determines if the
23+ database ID should be returned.
24+ - ** tActiveGroup** is optional and is used to give the database
25+ configuration group a name.
26+ - ** tOptions** the optional fourth parameter is a comma delimited
27+ list of SQLite options. It can be empty or can contain "binary",
28+ "extensions" or both. Note: This parameter is needless if all
2929 settings are included in the first parameter.
3030
31- Alternatively you can connect to an in-memory database or to a
32- new database. Build an initial table using the rigNewTableStructure()
31+ Alternatively you can connect to an in-memory database or to a
32+ new database. Build an initial table using the rigNewTableStructure()
3333function and connect using the rigConnectDB handler like:
3434
3535 put "INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT" into tInitTableA["recipe"][1]["ID"]
@@ -40,43 +40,43 @@ function and connect using the rigConnectDB handler like:
4040
4141 rigConnectDB tDBfilePath, tInitTable, tReturn, tActiveGroup, tOptions
4242
43- - ** tDBfilePath** the value of this optional parameter can be
44- empty or a file path or "memory" or "mem" or "in-memory" or
45- "in-mem" or "inmemory" or "inmem" for creating an in-memory
46- database. If it is empty the user is prompted to choose the
47- folder where the database is located. To create a new database
48- the dialog needs to be canceled.
49- - ** tInitTable** is optional and includes the array data to build
50- the initial table.
51- - ** tReturn** is a boolean which determines if the database ID should
52- be returned.
53- - ** tActiveGroup** is optional and is used to give the database
54- configuration group a name.
55- - ** tOptions** is a comma delimited list of SQLite options. It can
43+ - ** tDBfilePath** the value of this optional parameter can be
44+ empty or a file path or "memory" or "mem" or "in-memory" or
45+ "in-mem" or "inmemory" or "inmem" for creating an in-memory
46+ database. If it is empty the user is prompted to choose the
47+ folder where the database is located. To create a new database
48+ the dialog needs to be canceled.
49+ - ** tInitTable** is optional and includes the array data to build
50+ the initial table.
51+ - ** tReturn** is a boolean which determines if the database ID should
52+ be returned.
53+ - ** tActiveGroup** is optional and is used to give the database
54+ configuration group a name.
55+ - ** tOptions** is a comma delimited list of SQLite options. It can
5656 be empty or can contain "binary", "extensions" or both.
5757
5858### How to convert a query result array to a datagrid array:
5959
60- This library provides a handler which converts database query result arrays
61- to datagrid arrays.
60+ This library provides a handler which converts database query result arrays
61+ to datagrid arrays.
6262
6363 queryResultArrayToDgArray @pArray, pFields
6464
65- - ** pArray** is the database query result index named "resultarray"
66- - ** pFields** is the database query result index "fieldnames" which
65+ - ** pArray** is the database query result index named "resultarray"
66+ - ** pFields** is the database query result index "fieldnames" which
6767 contains the table field names in a numbered array
6868
6969Here is an example:
7070
7171 # ALL QUERY DATA
7272 put rigDbGet("recipe") into tQuery
73-
73+
7474 # THE QUERY RESULT ARRAY
7575 put tQuery["resultarray"] into tDataGridArray
76-
76+
7777 # CONVERT RESULT ARRAY TO DATGRID ARRAY
78- queryResultArrayToDgArray tDataGridArray, tQuery["fieldnames"]
79-
78+ queryResultArrayToDgArray tDataGridArray, tQuery["fieldnames"]
79+
8080 # POPULATE DATAGRID
8181 set the dgData of grp "myDatagrid" to tDataGridArray
8282
@@ -86,7 +86,7 @@ For the license terms see the LICENSE file.
8686
8787### Meta
8888
89- Version: 1.1.0
90- Web Site: < https://revigniter.com/ >
89+ Version: 1.1.1
90+ Web Site: < https://revigniter.com/ >
9191
9292Author: Ralf Bitter
0 commit comments