mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 03:58:20 +00:00
rename the dbname configuration option to tablename.
Sorry for this - I noticed that I named this option quite unfortunately while writing the documentation. The patch also removes the dbname configuration option from the sqlite input reader - it was not used there at all anymore (and I did not notice that).
This commit is contained in:
parent
c1c6b887c1
commit
363cfb8506
7 changed files with 9 additions and 24 deletions
|
@ -124,16 +124,16 @@ bool SQLite::DoInit(const WriterInfo& info, int arg_num_fields,
|
|||
|
||||
string fullpath(info.path);
|
||||
fullpath.append(".sqlite");
|
||||
string dbname;
|
||||
string tablename;
|
||||
|
||||
map<const char*, const char*>::const_iterator it = info.config.find("dbname");
|
||||
map<const char*, const char*>::const_iterator it = info.config.find("tablename");
|
||||
if ( it == info.config.end() )
|
||||
{
|
||||
MsgThread::Info(Fmt("dbname configuration option not found. Defaulting to path %s", info.path));
|
||||
dbname = info.path;
|
||||
MsgThread::Info(Fmt("tablename configuration option not found. Defaulting to path %s", info.path));
|
||||
tablename = info.path;
|
||||
}
|
||||
else
|
||||
dbname = it->second;
|
||||
tablename = it->second;
|
||||
|
||||
if ( checkError(sqlite3_open_v2(
|
||||
fullpath.c_str(),
|
||||
|
@ -145,7 +145,7 @@ bool SQLite::DoInit(const WriterInfo& info, int arg_num_fields,
|
|||
NULL)) )
|
||||
return false;
|
||||
|
||||
string create = "CREATE TABLE IF NOT EXISTS " + dbname + " (\n";
|
||||
string create = "CREATE TABLE IF NOT EXISTS " + tablename + " (\n";
|
||||
//"id SERIAL UNIQUE NOT NULL"; // SQLite has rowids, we do not need a counter here.
|
||||
|
||||
for ( unsigned int i = 0; i < num_fields; ++i )
|
||||
|
@ -193,7 +193,7 @@ bool SQLite::DoInit(const WriterInfo& info, int arg_num_fields,
|
|||
|
||||
// create the prepared statement that will be re-used forever...
|
||||
string insert = "VALUES (";
|
||||
string names = "INSERT INTO " + dbname + " ( ";
|
||||
string names = "INSERT INTO " + tablename + " ( ";
|
||||
|
||||
for ( unsigned int i = 0; i < num_fields; i++ )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue