Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
andyfengHKU committed Mar 30, 2024
1 parent fb4caca commit 1fed537
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,5 +235,3 @@ if (${BUILD_EXAMPLES})
add_subdirectory(examples/c)
add_subdirectory(examples/cpp)
endif()

add_subdirectory(examples/cpp)
13 changes: 7 additions & 6 deletions examples/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
using namespace kuzu::main;

int main() {
auto database = std::make_unique<Database>("/Users/xiyangfeng/Desktop/ku_play/issue-14-explorer-crashes" /* fill db path */);
auto database = std::make_unique<Database>("" /* fill db path */);
auto connection = std::make_unique<Connection>(database.get());

// Create schema.
\
connection->setMaxNumThreadForExec(1);
connection->query("CREATE NODE TABLE Person(name STRING, age INT64, PRIMARY KEY(name));");
// Create nodes.
connection->query("CREATE (:Person {name: 'Alice', age: 25});");
connection->query("CREATE (:Person {name: 'Bob', age: 30});");

// Execute a simple query.
auto result = connection->query("MATCH\n"
" (a:SnapArtifact { artifact_name: 'taxi_zones' })-[r]->(b)\n"
"RETURN *;");
auto result = connection->query("MATCH (a:Person) RETURN a.name AS NAME, a.age AS AGE;");
// Print query result.
std::cout << result->toString();
}
6 changes: 1 addition & 5 deletions src/include/storage/stats/table_statistics_collection.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,7 @@ class TablesStatistics {
return type == transaction::TransactionType::READ_ONLY ? readOnlyVersion.get() :
readWriteVersion.get();
}
// const TableStatistics* getTableStat(transaction::Transaction* tx, common::table_id_t
// tableID) const {
// return getVersion(tx)->getTableStat(tableID);
// }


void readFromFile();
void readFromFile(common::FileVersionType dbFileType);

Expand Down

0 comments on commit 1fed537

Please sign in to comment.