@@ -11,10 +11,12 @@ using namespace kuzu::common;
1111
1212void PyDatabase::initialize (py::handle& m) {
1313 py::class_<PyDatabase>(m, " Database" )
14- .def (py::init<const std::string&, uint64_t , uint64_t , bool , bool , uint64_t >(),
14+ .def (
15+ py::init<const std::string&, uint64_t , uint64_t , bool , bool , uint64_t , bool , int64_t >(),
1516 py::arg (" database_path" ), py::arg (" buffer_pool_size" ) = 0 ,
1617 py::arg (" max_num_threads" ) = 0 , py::arg (" compression" ) = true ,
17- py::arg (" read_only" ) = false , py::arg (" max_db_size" ) = (uint64_t )1 << 43 )
18+ py::arg (" read_only" ) = false , py::arg (" max_db_size" ) = (uint64_t )1 << 43 ,
19+ py::arg (" auto_checkpoint" ) = true , py::arg (" checkpoint_threshold" ) = -1 )
1820 .def (" scan_node_table_as_int64" , &PyDatabase::scanNodeTable<std::int64_t >,
1921 py::arg (" table_name" ), py::arg (" prop_name" ), py::arg (" indices" ), py::arg (" np_array" ),
2022 py::arg (" num_threads" ))
@@ -44,9 +46,13 @@ uint64_t PyDatabase::getStorageVersion() {
4446}
4547
4648PyDatabase::PyDatabase (const std::string& databasePath, uint64_t bufferPoolSize,
47- uint64_t maxNumThreads, bool compression, bool readOnly, uint64_t maxDBSize) {
48- auto systemConfig =
49- SystemConfig (bufferPoolSize, maxNumThreads, compression, readOnly, maxDBSize);
49+ uint64_t maxNumThreads, bool compression, bool readOnly, uint64_t maxDBSize,
50+ bool autoCheckpoint, int64_t checkpointThreshold) {
51+ auto systemConfig = SystemConfig (bufferPoolSize, maxNumThreads, compression, readOnly,
52+ maxDBSize, autoCheckpoint);
53+ if (checkpointThreshold >= 0 ) {
54+ systemConfig.checkpointThreshold = static_cast <uint64_t >(checkpointThreshold);
55+ }
5056 database = std::make_unique<Database>(databasePath, systemConfig);
5157 database->addTableFunction (kuzu::PandasScanFunction::name,
5258 kuzu::PandasScanFunction::getFunctionSet ());
0 commit comments