101 | | Originally I thought it would be necessary to define a src/os_rtems.c because of issues with shared memory support, and thus would need to use the network filesystem, but as that is no longer an issue, I would suggest using one of the network-demos with a filesystem as a code-base to copy and the [http://www.sqlite.org/quickstart.html SQLite quickstart] guide as guideline for the database demo. |
| 101 | # Link the SQLite library using a Makefile. |
| 102 | # Use [http://www.sqlite.org/cintro.html An Introduction To The SQLite C/C++ Interface] as a guideline for the test. |
| 103 | So the idea would be to: |
| 104 | # Open the database |
| 105 | # Prepare the SQL statement for processing |
| 106 | # "Step" through the results, in this case, an insert (or make table?) would be awesome! |
| 107 | # Some simple column statement |
| 108 | # Finalize (delete) the prepared statement |
| 109 | # Close the connection. |
| 110 | So, a test would look like: |
| 111 | /* SQL Test */ |
| 112 | /* Database initialization */ |
| 113 | printk("Opening the Database\n"); |
| 114 | sqlite3_open(filename, &ppDb, flags, &zVfs); |
| 115 | |
| 116 | printk("Preparing the SQL Statement\n"); |
| 117 | sqlite3_prepare_v2(&db, &zSql, nByte, &ppStmt, &pzTail); |
| 118 | |
| 119 | printk("Stepping through the Results\n"); |
| 120 | sqlite3_step(&ppStmt); |
| 121 | |
| 122 | printk("Counting the number of columns..."); |
| 123 | nCols = sqlite3_column_count(&ppStmt); |
| 124 | printk("and the number of columns is %d\n", nCols); |
| 125 | |
| 126 | printk("Deleting the SQL Statement\n"); |
| 127 | sqlite3_finalize(&ppStmt); |
| 128 | |
| 129 | printk("Closing the Database"); |
| 130 | sqlite3_close(&ppDb); |