Skip to content

Commit

Permalink
chore(persist): get persist db
Browse files Browse the repository at this point in the history
  • Loading branch information
fengzeroz committed Mar 17, 2023
1 parent 54dfc37 commit c3ed9cc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
File renamed without changes.
6 changes: 5 additions & 1 deletion include/neuron/persist/persist.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
extern "C" {
#endif

#include "adapter/adapter_info.h"
#include <sqlite3.h>

#include "adapter_info.h"
#include "persist/json/persist_json_plugin.h"

typedef neu_json_plugin_req_plugin_t neu_persist_plugin_info_t;
Expand Down Expand Up @@ -90,6 +92,8 @@ int neu_persister_create(const char *schema_dir);
*/
void neu_persister_destroy();

sqlite3 *neu_persister_get_db();

/**
* Persist nodes.
* @param node_info neu_persist_node_info_t.
Expand Down
5 changes: 5 additions & 0 deletions src/persist/persist.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,11 @@ int neu_persister_create(const char *schema_dir)
return 0;
}

sqlite3 *neu_persister_get_db()
{
return global_db;
}

void neu_persister_destroy()
{
sqlite3_close(global_db);
Expand Down

0 comments on commit c3ed9cc

Please sign in to comment.