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))); }
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)))); }
private static string GetIndexType(NpgIndexType indexType) { switch (indexType) { case NpgIndexType.Btree: return("BTREE"); default: throw new NotSupportedException(string.Format("NpgIndexType " + indexType)); } }
private static string GetIndexType(NpgIndexType indexType) { switch (indexType) { case NpgIndexType.Btree: return "BTREE"; default: throw new NotSupportedException(string.Format("NpgIndexType " + indexType)); } }