Difference between revisions of "Truxton clean database"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "This will go through the tables looking for unreferenced (orphaned) records and delete them. =Syntax= <source lang="C"> uint32_t truxton_clean_database( uint64_t truxton_hand...")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
This will go through the tables looking for unreferenced (orphaned) records and delete them.
+
This send a [[Message Bus Messages#Clean Database|message]] to the maintenance ETL to go through the tables looking for unreferenced (orphaned) records and delete them.
  
 
=Syntax=
 
=Syntax=
Line 11: Line 11:
  
 
=Return value=
 
=Return value=
Zero if the message could not be sent to the <code>maintenance</code> queue, non-zero if the message was successfully sent.
+
Zero if the [[Message Bus Messages#Clean Database|message]] could not be sent to the <code>maintenance</code> queue, non-zero if the message was successfully sent.
  
 
=Sample=
 
=Sample=
Line 19: Line 19:
 
   if ( truxton_clean_database( truxton ) != 0 )
 
   if ( truxton_clean_database( truxton ) != 0 )
 
   {
 
   {
       printf( "FINE! OK!\n" );
+
       printf( "FINE! OK!\n" ); // obviously a teenage database
 
   }
 
   }
 
}
 
}
 
</source>
 
</source>

Latest revision as of 15:52, 27 July 2022

This send a message to the maintenance ETL to go through the tables looking for unreferenced (orphaned) records and delete them.

Syntax

uint32_t truxton_clean_database( uint64_t truxton_handle );

Parameters

truxton_handle

The handle created by the truxton_create call.

Return value

Zero if the message could not be sent to the maintenance queue, non-zero if the message was successfully sent.

Sample

void clean_your_room( uint64_t truxton )
{
   if ( truxton_clean_database( truxton ) != 0 )
   {
      printf( "FINE! OK!\n" ); // obviously a teenage database
   }
}