Revision 9158a2b9

View differences:

include/LogDB.h
199 199
    // -------------------------------------------------------------------------
200 200
    // Database methods
201 201
    // -------------------------------------------------------------------------
202
    static int bootstrap(SqlDB *_db)
203
    {
204
        std::ostringstream oss(db_bootstrap);
205

  
206
        return _db->exec_local_wr(oss);
207
    }
202
    static int bootstrap(SqlDB *_db);
208 203

  
209 204
    /**
210 205
     *  This function gets and initialize log related index
src/sql/LogDB.cc
32 32
    "timestamp INTEGER, fed_index INTEGER)";
33 33

  
34 34
/* -------------------------------------------------------------------------- */
35

  
36
int LogDB::bootstrap(SqlDB *_db)
37
{
38
    int rc;
39

  
40
    std::ostringstream oss(db_bootstrap);
41

  
42
    rc = _db->exec_local_wr(oss);
43

  
44
    // Create indexes
45
    oss.str("CREATE INDEX fed_index_idx on logdb (fed_index);");
46

  
47
    rc += _db->exec_local_wr(oss);
48

  
49
    oss.str("CREATE INDEX timestamp_idx on logdb (timestamp);");
50

  
51
    rc += _db->exec_local_wr(oss);
52

  
53
    return rc;
54
};
55

  
56
/* -------------------------------------------------------------------------- */
35 57
/* -------------------------------------------------------------------------- */
36 58

  
37 59
int LogDBRecord::select_cb(void *nil, int num, char **values, char **names)

Also available in: Unified diff