1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
Berkeley DB SQL API
===============================================================================
Content overview:
===============================================================================
1) sql/adapater: the source files that implement the changes to SQLite in order
to use Berkeley DB as a storage engine, instead of the default btree
implementation in SQLite.
2) sql/sqlite: The unpacked archive of SQLite source, "as extracted from
the version control system", modified to use Berkeley DB as the backend.
3) sql/generated: Contains pre-generated versions of files used by amalgamated
and Windows builds.
Building
===============================================================================
Linux/Unix/Cygwin:
Simply add the "--enable-sql" switch to the configure command.
In more detail:
It is possible to generate a few different outputs using configure.
They are:
1) libdb_sqlXX.{so|la} - A C API library, that exactly mirrors the SQLite
C API.
2) dbsql - A command line SQL interpreter, that exactly matches
the default sqlite3 command line interpreter.
3) sqlite.{so|la} - A C API library, that exactly mirrors the SQLite C API,
and has the same name as the library generated by a SQLite build.
4) sqlite3 - A command line SQL interpreter, that exactly matches the
semantics and name of the default sqlite3 command line interpreter.
5) sql/testfixture - The SQLite Tcl test runner. This can be used to run
the test cases in the sql/sqlite/test directory.
The flags required to generate the above components are:
--enable-sql - will generate 1, 2
--enable-sql_compat - will generate 1, 2, 3, 4
--enable-sql --enable-test --with-tcl=blah will generate 1, 2, 5
--enable-sql_compat --enable-test --with-tcl=blah will generate 1, 2, 3, 4, 5
Windows with Visual Studio 2005 or newer:
- Open the build_windows/Berkeley_DB.sln file in Visual Studio.
- There are three project relevant to the SQL API:
- db_sql - the C API library, output as libdb_sqlXX.dll
- db_sql_shell - the SQL command line interpreter
- db_sql_testfixture - the testfixture Tcl test runner application. It is
necessary to have Tcl installed and available in Visual Studio to build
the testfixture component.
Running tests
===============================================================================
Configure based builds:
$ cd build_unix/sql
$ ./testfixture ../../sqlite-3.*/test/insert.test
To debug into the SQLite code:
$ gdb --args ./.libs/testfixture ../sqlite-3.*/test/insert.test
At the GDB prompt type "run", then retry with other tests, etc.
Windows based builds:
Open the Berkeley_DB.sln solution file in Visual Studio 2005 or newer.
Build the db_sql_testfixture project.
If debugging via Visual Studio, set the command line options in the
project settings to: ../../sql/sqlite/test/insert.test (or any other
test you want to run). Then start a debug session.
More information
===============================================================================
See the Using the Berkeley DB SQL documentation on www.oracle.com.
|