1
1
# LiveCode SQLite library
2
2
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.
7
7
8
8
### Requirements
9
9
10
- LiveCode version 9 or higher
10
+ LiveCode version 9 or higher
11
11
12
12
### How to use this library:
13
13
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:
16
16
17
17
get rigLoadDatabase(tParams, tReturn, tActiveGroup, tOptions)
18
18
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
21
21
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
29
29
settings are included in the first parameter.
30
30
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()
33
33
function and connect using the rigConnectDB handler like:
34
34
35
35
put "INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT" into tInitTableA["recipe"][1]["ID"]
@@ -40,43 +40,43 @@ function and connect using the rigConnectDB handler like:
40
40
41
41
rigConnectDB tDBfilePath, tInitTable, tReturn, tActiveGroup, tOptions
42
42
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
56
56
be empty or can contain "binary", "extensions" or both.
57
57
58
58
### How to convert a query result array to a datagrid array:
59
59
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.
62
62
63
63
queryResultArrayToDgArray @pArray, pFields
64
64
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
67
67
contains the table field names in a numbered array
68
68
69
69
Here is an example:
70
70
71
71
# ALL QUERY DATA
72
72
put rigDbGet("recipe") into tQuery
73
-
73
+
74
74
# THE QUERY RESULT ARRAY
75
75
put tQuery["resultarray"] into tDataGridArray
76
-
76
+
77
77
# CONVERT RESULT ARRAY TO DATGRID ARRAY
78
- queryResultArrayToDgArray tDataGridArray, tQuery["fieldnames"]
79
-
78
+ queryResultArrayToDgArray tDataGridArray, tQuery["fieldnames"]
79
+
80
80
# POPULATE DATAGRID
81
81
set the dgData of grp "myDatagrid" to tDataGridArray
82
82
@@ -86,7 +86,7 @@ For the license terms see the LICENSE file.
86
86
87
87
### Meta
88
88
89
- Version: 1.1.0
90
- Web Site: < https://revigniter.com/ >
89
+ Version: 1.1.1
90
+ Web Site: < https://revigniter.com/ >
91
91
92
92
Author: Ralf Bitter
0 commit comments