提交 465bd199 编写于 作者: X xj.lin

fix bug


Former-commit-id: 1c21d81875ec000c6f26ef8f2c367df8992fde59
上级 a7657e1e
......@@ -6,22 +6,18 @@
#include "db_connection.h"
#include <string>
#include <iostream>
#include <thread>
namespace zilliz {
namespace vecwise {
namespace engine {
using std::cout;
using std::endl;
using std::string;
using namespace sqlite_orm;
string storage_file_name = "default.sqlite"
string storage_file_name = "default.sqlite";
DbPtr connect() {
DbPtr temp = std::make_shared<SqliteDB>(initStorage(storage_file_name));
SqliteDBPtr connect() {
SqliteDBPtr temp = std::make_shared<SqliteDB>(initStorage(storage_file_name));
temp->sync_schema();
temp->open_forever(); // thread safe option
temp->pragma.journal_mode(journal_mode::WAL); // WAL => write ahead log
......
......@@ -6,6 +6,11 @@
#pragma once
#include <string>
#include <memory>
#include <sqlite_orm/sqlite_orm.h>
namespace zilliz {
namespace vecwise {
......@@ -36,8 +41,9 @@ struct GroupFileSchema {
}; // GroupFileSchema
inline auto initStorage(const std::string &path) {
using namespace sqlite_orm;
return make_storage(path,
// Add table below
// Add table below
make_table("Groups",
make_column("id", &GroupSchema::id, primary_key()),
make_column("group_id", &GroupSchema::group_id, unique()),
......@@ -46,7 +52,7 @@ inline auto initStorage(const std::string &path) {
}
using SqliteDB = decltype(initStorage(""));
using SqliteDBPtr= std::shared_ptr<Db>;
using SqliteDBPtr= std::shared_ptr<SqliteDB>;
class Connection {
protected:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册