示例#1
0
 public NpgQuery CreateIndex(string table, NpgIndexType indexType, bool unique, params string[] columns)
 {
     return new NpgQuery(string.Format("CREATE {0}INDEX i_{1}_{2} ON {1} USING {3} ({4})",
          unique ? "UNIQUE " : string.Empty,
          table,
          string.Join("_", columns),
          GetIndexType(indexType),
          string.Join(", ", columns)));
 }
示例#2
0
 public NpgQuery CreateIndex(string table, NpgIndexType indexType, bool unique, params string[] columns)
 {
     return(new NpgQuery(string.Format("CREATE {0}INDEX i_{1}_{2} ON {1} USING {3} ({4})",
                                       unique ? "UNIQUE " : string.Empty,
                                       table,
                                       string.Join("_", columns),
                                       GetIndexType(indexType),
                                       string.Join(", ", columns))));
 }
示例#3
0
        private static string GetIndexType(NpgIndexType indexType)
        {
            switch (indexType)
            {
            case NpgIndexType.Btree:
                return("BTREE");

            default:
                throw new NotSupportedException(string.Format("NpgIndexType " + indexType));
            }
        }
示例#4
0
 private static string GetIndexType(NpgIndexType indexType)
 {
     switch (indexType)
     {
         case NpgIndexType.Btree:
             return "BTREE";
         default:
             throw new NotSupportedException(string.Format("NpgIndexType " + indexType));
     }
 }