Executable that will resequence ids in all tables of a postgres database
built with .netcore 8.0
Cross Platform Compatible
25'ten fazla konu seçemezsiniz
Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
|
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
-
- namespace resequence_pgsql
- {
- public class ArgHelper
- {
- public static ArgSimple GetArgs(string[] args)
- {
- ArgSimple a = new ArgSimple();
- foreach (string arg in args)
- {
- string[] pcs = arg.Split(':');
- switch (pcs[0])
- {
- case "-ip": a.ip = pcs[1]; break;
- case "-u": a.un = pcs[1]; break;
- case "-pwd": a.pwd = pcs[1]; break;
- case "-lip": a.lip = pcs[1]; break;
- case "-p": a.port = Convert.ToInt32(pcs[1]); break;
- case "-db": a.db = pcs[1]; break;
- }
-
- }
-
- return a;
- }
-
- }
- public class ArgSimple
- {
- public string ip { get; set; } = string.Empty;
- public string un { get; set; } = string.Empty;
- public string pwd { get; set; } = string.Empty;
- public string lip { get; set; } = string.Empty;
- public int? port { get; set; } = null;
- public string db { get; set; } = string.Empty;
- }
- }
|