diff options
author | Jochen Topf <jochen@topf.org> | 2014-05-13 15:43:13 +0200 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2014-05-13 15:43:13 +0200 |
commit | 5167802ba9e30f17ea71e0783c475764fdb8ec64 (patch) | |
tree | aac187a9c4d7e855def0b5c366725e8b5e2d4fce /tagstats/osmstats.cpp | |
parent | 2bc6d4d03b91b0f019f96f37512534074f33b660 (diff) | |
download | taginfo-5167802ba9e30f17ea71e0783c475764fdb8ec64.tar taginfo-5167802ba9e30f17ea71e0783c475764fdb8ec64.tar.gz |
Use sqlite db file instead of text *.lst files for selected data.
This changes the way some data is given from one taginfo update run
to the next. Instead of plain text files an sqlite database is used.
Part of the update is a new version of the upstream sqlite.hpp file.
After this commit the update has to be run twice to get all data
updated properly.
Diffstat (limited to 'tagstats/osmstats.cpp')
-rw-r--r-- | tagstats/osmstats.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/tagstats/osmstats.cpp b/tagstats/osmstats.cpp index bfd757d..cb4cc93 100644 --- a/tagstats/osmstats.cpp +++ b/tagstats/osmstats.cpp @@ -37,17 +37,8 @@ int main(int argc, char *argv[]) { Osmium::OSMFile infile(argv[1]); - Sqlite::Database db(argv[2]); - sqlite3* sqlite_db = db.get_sqlite3(); - if (SQLITE_OK != sqlite3_exec(sqlite_db, \ - "CREATE TABLE stats (" \ - " key TEXT, " \ - " value INT64 " \ - ");", 0, 0, 0)) { - std::cerr << "Database error: " << sqlite3_errmsg(sqlite_db) << "\n"; - sqlite3_close(sqlite_db); - exit(1); - } + Sqlite::Database db(argv[2], SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE); + db.exec("CREATE TABLE stats (key TEXT, value INT64);"); StatisticsHandler handler(db); Osmium::Input::read(infile, handler); |