library/src/databases/bpdb/BP-DB.cc
// This attempts to flush records out to the database.
This attempts to flush records out to the database.
This attempts to flush records out to the database .
BP_ERROR_T BP_DBFlushRecordsOut(P_BPDB bpdb, BPDB_SELECTOR_TYPE out_db_selector, BP_BOOL run_in_transaction)
{
	if(!bpdb)
		return ERR_FAILURE;
	if(!out_db_selector)
		return ERR_FAILURE;
	P_BPDB_SQLGEN syngen = BP_DBSGOpen(bpdb);
	if(!syngen)
		return ERR_FAILURE;
	printf("\n [!!] Attempting to flush records to selected db: %p", syngen);
	switch(out_db_selector)
	{
		case BPDB_SELECTOR_TYPE_LOCALCACHE_DATABASE:
			printf("\n [+] Flushing to local database.");
			BP_DBFlushRecordsOutToLocalCache(bpdb, syngen, run_in_transaction);
			break;
		case BPDB_SELECTOR_TYPE_PERSISTENT_DATABASE:
			break;
		case BPDB_SELECTOR_TYPE_BOTH_DATABASES:
			BP_DBFlushRecordsOutToLocalCache(bpdb, syngen, run_in_transaction);
			break;
	}
	return ERR_SUCCESS;
}
BP_ERROR_T BP_DBFlushRecordsOut ( P_BPDB bpdb , BPDB_SELECTOR_TYPE out_db_selector , BP_BOOL run_in_transaction ) { if ( ! bpdb ) return ERR_FAILURE ; if ( ! out_db_selector ) return ERR_FAILURE ; P_BPDB_SQLGEN syngen = BP_DBSGOpen ( bpdb ) ; if ( ! syngen ) return ERR_FAILURE ; printf ( " \n " , syngen ) ; switch ( out_db_selector ) { case BPDB_SELECTOR_TYPE_LOCALCACHE_DATABASE : printf ( " \n " ) ; BP_DBFlushRecordsOutToLocalCache ( bpdb , syngen , run_in_transaction ) ; break ; case BPDB_SELECTOR_TYPE_PERSISTENT_DATABASE : break ; case BPDB_SELECTOR_TYPE_BOTH_DATABASES : BP_DBFlushRecordsOutToLocalCache ( bpdb , syngen , run_in_transaction ) ; break ; } return ERR_SUCCESS ; }
This attempts to flush records out to the database.
This attempts to flush records out to the database .
// run basic null checks // create new syntax generator // verbosity (optional) // switch/action based on database selector // return indicating success