
/*---------------------------------------------------------------------------*/
/* dataset_shared.h                                                          */
/* copyright (c) innovaphone 2023                                            */
/*                                                                           */
/*---------------------------------------------------------------------------*/

#include <platform.h>

#include "common/ilib/str.h"
#include "sdk/common/interface/database.h"

#include "database_shared.h"

/*---------------------------------------------------------------------------*/
/* class UDatabase                                                           */
/*---------------------------------------------------------------------------*/
UDatabase::UDatabase()
	: owner(nullptr)
{
}


UDatabase::~UDatabase()
{
	// The owner will be set in PostgreSQLDatabase::HandleTopStackItem() and reset to nullptr in PostqreSQLDatabase::RequestNextStackItem().
	// Doing this will make sure, that the owner only is set and used when the a command for a user is currently executed.
	if (this->owner != nullptr) this->owner->DatabaseUserDeleted(this);
}
