Executable that will resequence ids in all tables of a postgres database built with .netcore 8.0 Cross Platform Compatible
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

41 linhas
1.1 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. namespace resequence_pgsql
  6. {
  7. public class ArgHelper
  8. {
  9. public static ArgSimple GetArgs(string[] args)
  10. {
  11. ArgSimple a = new ArgSimple();
  12. foreach (string arg in args)
  13. {
  14. string[] pcs = arg.Split(':');
  15. switch (pcs[0])
  16. {
  17. case "-ip": a.ip = pcs[1]; break;
  18. case "-u": a.un = pcs[1]; break;
  19. case "-pwd": a.pwd = pcs[1]; break;
  20. case "-lip": a.lip = pcs[1]; break;
  21. case "-p": a.port = Convert.ToInt32(pcs[1]); break;
  22. case "-db": a.db = pcs[1]; break;
  23. }
  24. }
  25. return a;
  26. }
  27. }
  28. public class ArgSimple
  29. {
  30. public string ip { get; set; }
  31. public string un { get; set; }
  32. public string pwd { get; set; }
  33. public string lip { get; set; }
  34. public int port { get; set; }
  35. public string db { get; set; }
  36. }
  37. }