Truxton add database id

From truxwiki.com
Jump to navigation Jump to search

This will associate a table name with a file type for more accurately identifying a database. This will add a record to the [DatabaseTableName] table.

Syntax

uint32_t truxton_add_database_id( uint64_t truxton_handle, uint64_t file_type_id, char const * table_and_column );

Parameters

truxton_handle

The handle created by the truxton_create call.

file_type_id

The type of file to associate with this table name. This corresponds to the [FileTypeID] column of the [DatabaseTableName] table.

table_and_column

The name of the table and column to associate with the file type. This corresponds to the [Name] column of the [DatabaseTableName] table.

Remarks

The table_and_column parameter string should be in the format of "table.column" Specifying both table and column is the recommended method for identifying a file type.

When adding a mapping, it is better to choose table column pairs that aren't likely to appear in another file type. For example, "user.id" is likely to appear in several different types of databases and therefore, not a good pair to associate with any file type.

Sample

void add_my_database_id( uint64_t truxton_handle )
{
   truxton_add_database_id( truxton, Type_010_Help_Viewer, "ContentsTable.NamespaceId" );
   truxton_add_database_id( truxton, Type_010_Help_Viewer, "FileAttributeSetTable.FilterAttributeSetId" );
   truxton_add_database_id( truxton, Type_010_Help_Viewer, "FolderTable.NamespaceId" );
   truxton_add_database_id( truxton, Type_010_Help_Viewer, "IndexTable.Anchor" );
   truxton_add_database_id( truxton, Type_010_Help_Viewer, "OptimizedFilterTable.FilterAttributeId" );
   truxton_add_database_id( truxton, Type_010_Help_Viewer, "TimeStampTable.NamespaceId" );
}