You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
411 B

  1. #pragma once
  2. #include <db/db.h>
  3. #include <db/Schema.h>
  4. #include <string>
  5. namespace db {
  6. sql::Database* init(std::string name) {
  7. sql::Database* db = new sql::Database(name, SQLite::OPEN_READWRITE|SQLite::OPEN_CREATE);
  8. DEBUG << "SQLite database file '" << db->getFilename().c_str() << "' opened successfully\n";
  9. Schema* schema = new Schema(db);
  10. schema->run_migrations();
  11. return db;
  12. }
  13. }