Skip to content

Commit

Permalink
Made sqlite use an in memory database.
Browse files Browse the repository at this point in the history
git-svn-id: https://subversion.cs.uiuc.edu/svn/bang/eoh2009@25 69d76c3e-0761-0410-948c-9895a8bb34fc
  • Loading branch information
nbysani2 committed Jan 24, 2009
1 parent 2292591 commit d4a2d3a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/base/bang-routing.c
Expand Up @@ -12,6 +12,7 @@
#include<uuid/uuid.h>

#define DB_SCHEMA "CREATE TABLE mappings(route_uuid blob unique primary key, remote integer, peer_id int, module blob, name text, version blob)"
#define DB_FILE ":memory:"
#define REMOTE_ROUTE 2
#define LOCAL_ROUTE 1

Expand Down Expand Up @@ -252,10 +253,10 @@ void BANG_route_close() {
#endif
/* Keep the mappings database in memory. */
#ifdef NEW_SQLITE
sqlite3_open_v2(":memory",&db,SQLITE_OPEN_READWRITE | SQLITE_OPEN_FULLMUTEX,NULL);
sqlite3_open_v2(DB_FILE,&db,SQLITE_OPEN_READWRITE | SQLITE_OPEN_FULLMUTEX,NULL);
#else
/* Dcl needs to update their sqlite3 libraries =/ */
sqlite3_open(":memory",&db);
sqlite3_open(DB_FILE,&db);
#endif

/*TODO: check for errors.
Expand Down

0 comments on commit d4a2d3a

Please sign in to comment.