-
Hello, I have a sync with various filters with customWhere and have problems with the synced data. If there is similar question, please redirect me to that discussion. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello, If you are using SQL Server, you can find the related SQL Stored procedure in your database. Usually, for each tables you may find a stored procedure called "Table_changes" or something If you are using SQLite (or any other database, even SQL Server) you can use the interceptor " Here is an example : agent.RemoteOrchestrator.OnExecuteCommand(args =>
{
Console.WriteLine(args.Command.CommandText);
}); and a full version of it: var agent = new SyncAgent(clientProvider, serverProvider, options);
agent.RemoteOrchestrator.OnExecuteCommand(args =>
{
Console.WriteLine($"SQL SERVER: {args.Command.CommandText}");
});
agent.LocalOrchestrator.OnExecuteCommand(args =>
{
Console.WriteLine($"SQLITE: {args.Command.CommandText}");
});
do
{
try
{
Console.ForegroundColor = ConsoleColor.Green;
var s = await agent.SynchronizeAsync(scopeName, setup, progress: progress);
Console.WriteLine(s);
}
catch (SyncException e)
{
Console.ResetColor();
Console.WriteLine(e.Message);
}
catch (Exception e)
{
Console.ResetColor();
Console.WriteLine("UNKNOW EXCEPTION : " + e.Message);
}
Console.WriteLine("--------------------");
}
while (Console.ReadKey().Key != ConsoleKey.Escape); Let me know if that helps |
Beta Was this translation helpful? Give feedback.
-
Thank you, it helps me very much. Is correct that the stored procedures are not overwritten? I´m using 0.9.8v Best regards, |
Beta Was this translation helpful? Give feedback.
Hello,
If you are using SQL Server, you can find the related SQL Stored procedure in your database. Usually, for each tables you may find a stored procedure called "Table_changes" or something
If you are using SQLite (or any other database, even SQL Server) you can use the interceptor "
OnExecuteCommand
" to intercept any query to your database.Here is an example :
and a full version of it: