#include <iostream>
#include "fhiclcpp/DatabaseSupport.h"
#include "sqlite3.h"
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 9 of file fhicl-write-db.cc.
References fhicl::parse_file_and_fill_db().
12 cerr << argv[0] <<
": two arguments required\n" 13 <<
"Usage: " << argv[0] <<
" fhicl-file database-file\n\n";
17 char const* fhiclfile = argv[1];
18 char const* dbname = argv[2];
20 sqlite3* db =
nullptr;
22 int rc = sqlite3_open_v2(
23 dbname, &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
nullptr);
24 if (rc != SQLITE_OK) {
25 cerr << argv[0] <<
": unable to open SQLite3 file " << dbname <<
'\n';
30 rc = sqlite3_close(db);
31 if (rc != SQLITE_OK) {
32 cerr << argv[0] <<
": failure closing SQLite file " << dbname
33 <<
"; file may be corrupt\n";
void parse_file_and_fill_db(std::string const &filename, sqlite3 *db)