/// <summary> /// To avoid spiky INSERT performance, an application can run the /// "merge=X,Y" command periodically, possibly in an idle thread or /// idle process. /// The idle thread that is running the merge commands can know when /// it is done by checking the difference in sqlite3_total_changes() /// before and after each "merge=X,Y" command and stopping the loop /// when the difference drops below two. /// </summary> /// <typeparam name="T"> /// The table on which to perform the merges. /// </typeparam> /// <param name="database">The database to use.</param> public static int RunMergeUntilOptimal <T>(this SqliteSessionBase database) { return(database.RunMergeUntilOptimal(typeof(T))); }