SQLite wrapper.
---------------

Ben Clewett, April 2005.

Version 0.0.2

This provides a simple method of returning a memory resident table from a query.

There is no warranty, the code provided for illustration reasons only. Any user wishing to make use of this does so at their own risk.


To test.
--------

Edit Makefile, alter line 2 for your setup.
$ make
$ ./test | more


Basic API details.
------------------

Query:
	sw_result *sw_query(sqlite3 *handle, const char *query);

Data:
	const unsigned char *sw_cell(sw_result *result, unsigned int row, unsigned int col);

Delete result:
	void sw_free_result(sw_result *result);

Sample use:

	sw_result *result;
	result = sw_query(sqlite_handle, "SELECT * FROM table");
	printf("Data %s, %s, %s\n", sw_cell(result, 0, 0), sw_cell(result, 0, 1), sw_cell(result, 23, 2));
	sw_free_result(result);

Full list contained in .h file.

Discussion.
-----------

This provides certain advantages:
 - Very simple to use.
 - Less problem with concurrency locking.
 - Lock released on all parts of database after generation of table.
 - Can hold many tables for as long as you wish in memory.
 - Can stream memory object through TCP/IP if wish.
 - Better test for NULL introduced.
 - Range of output's provided

There are certain limits in this software:
 - All data is internally text.  This is actually good for streaming.
 - No '16' version of API currently implemented.

There are also certain intrinsic limits:
 - Very slightly slower.  You will not notice.
 - Not suitable for very large result sets.


Bugs.
-----

Exhausive memory tests not completed.  Probably more.

TODO.
-----

- Provide a function to stream data in <---> out a result, so that can stream it.
- Provide a call to take a prepared statement.
- Obtain schema data with column headings.
- Add binary data to result. (Not good for streaming where numbers may not work on different OS)
- Complete the '16' interface.
