SqlDestroyDatabase(object)

From NWN Lexicon
Jump to: navigation, search

Destroys the given sqlite database, clearing out all data and schema.

void SqlDestroyDatabase(
    object oObject
);

Parameters

oObject
Object to destroy the database on. Same as SqlPrepareQueryObject(). To reset a campaign database, please use DestroyCampaignDatabase().

Description

Destroys the given sqlite database, clearing out all data and schema. This operation is immediate and irreversible, even when inside a transaction or running query.

Existing active/prepared sqlqueries will remain functional, but any references to stored data or schema members will be invalidated.

To reset a campaign database, please use DestroyCampaignDatabase().

Remarks

oObject can refer to a PC or to the module via. GetModule, as noted use DestroyCampaignDatabase for those databases.

Version

This function was added in 1.80.8193.14 of NWN:EE.

Example

void main()
{
    // Destroy the first PC's database
    object oPC = GetFirstPC();
    SqlDestroyDatabase(oPC);
 
    // Destroy the module database
    object oModule = GetModule();
    SqlDestroyDatabase(oModule);
}

See Also

functions:

DestroyCampaignDatabase