|
1 | 1 | # LiveCode SQLite library |
2 | 2 |
|
3 | | -A LiveCode SQLite library borrowed from revIgniter. |
| 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 | + |
| 8 | +### How to use this library: |
| 9 | + |
| 10 | +Place the library in the message path, then call the rigLoadDatabase |
| 11 | +function to connect to your database like: |
| 12 | + |
| 13 | +`get rigLoadDatabase(tParams, tReturn, tActiveGroup, tOptions)` |
| 14 | + |
| 15 | +- **tParams** can optionally be a path |
| 16 | + to a database or an array of database settings like the settings |
| 17 | + in revIgniter's database.lc. |
| 18 | +- **tReturn** is an optional boolean which determines if the |
| 19 | + database ID should be returned. |
| 20 | +- **tActiveGroup** is optional and is used to give the database |
| 21 | + configuration group a name. |
| 22 | +- **tOptions** the optional fourth parameter is a comma delimited |
| 23 | + list of SQLite options. It can be empty or can contain "binary", |
| 24 | + "extensions" or both. Note: This parameter is needless if all |
| 25 | + settings are included in the first parameter. |
| 26 | + |
| 27 | +Alternatively you can connect to an in-memory database or to a |
| 28 | +new database. Build an initial table using the rigNewTableStructure() |
| 29 | +function and connect using the rigConnectDB handler like: |
| 30 | + |
| 31 | +`put "INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT" into tInitTableA["recipe"][1]["ID"] |
| 32 | +put "varchar(255,0) DEFAULT NULL" into tInitTableA["recipe"][2]["Name"] |
| 33 | +put "TEXT" into tInitTableA["recipe"][3]["Directions"] |
| 34 | +put rigNewTableStructure(tInitTableA) into tInitTable |
| 35 | +rigConnectDB tDBfilePath, tInitTable tReturn tActiveGroup tOptions` |
| 36 | + |
| 37 | +- **tDBfilePath** the value of this optional parameter can be |
| 38 | + empty or a file path or "memory" or "mem" or "in-memory" or |
| 39 | + "in-mem" or "inmemory" or "inmem" for creating an in-memory |
| 40 | + database. If it is empty the user is prompted to choose the |
| 41 | + folder where the database is located. To create a new database |
| 42 | + the dialog needs to be canceled. |
| 43 | +- **tInitTable** is optional and includes the array data to build |
| 44 | + the initial table. |
| 45 | +- **tReturn** is a boolean which determines if the database ID should |
| 46 | + be returned. |
| 47 | +- **tActiveGroup** is optional and is used to give the database |
| 48 | + configuration group a name. |
| 49 | +- **tOptions** is a comma delimited list of SQLite options. It can |
| 50 | + be empty or can contain "binary", "extensions" or both. |
| 51 | + |
| 52 | +### License |
| 53 | + |
| 54 | +For the license terms see the LICENSE file. |
| 55 | + |
| 56 | +### Meta |
| 57 | + |
| 58 | +Version: |
| 59 | +Web Site: <https://revigniter.com/> |
| 60 | + |
| 61 | +Author: Ralf Bitter |
0 commit comments