Skip to content

Guidance with UploadOnly Sync. #1290

Answered by Mimetis
Daxter98 asked this question in Q&A
Dec 19, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

You want to keep the rows for all tables that are upload only right, when making a reinit ?

Once thing you can test (I didn't test, but it's worth a try) is to intercept the command when a reset is occurring.
The idea is to replace the CommandText property with something that will work but will not delete all the rows:

agent.LocalOrchestrator.OnGetCommand(args =>
{
  if (args.CommandType == DbCommandType.Reset)
  {
      var setupTable = args.ScopeInfo.Setup.Tables[args.Table.TableName, args.Table.SchemaName];

      if (setupTable != null && setupTable.SyncDirection == SyncDirection.UploadOnly)
          args.Command.CommandText = "Select 1;";
  }
});

All the rows from UploadOnly tables,…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Daxter98
Comment options

@Mimetis
Comment options

@Daxter98
Comment options

Answer selected by Daxter98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants