feat: default create_index to create-only

This commit is contained in:
ChilePiquin
2026-09-03 14:24:27 -07:00
parent 2779b75d0d
commit bd86cc5aa6
10 changed files with 113 additions and 70 deletions
+1 -5
View File
@@ -1526,11 +1526,7 @@ describe("When creating an index", () => {
it("should allow me to replace (or not) an existing index", async () => {
await tbl.createIndex("id");
// Default is replace=true
await tbl.createIndex("id");
await expect(tbl.createIndex("id", { replace: false })).rejects.toThrow(
"already exists",
);
await expect(tbl.createIndex("id")).rejects.toThrow("already exists");
await tbl.createIndex("id", { replace: true });
});
+1 -1
View File
@@ -841,7 +841,7 @@ export interface IndexOptions {
* and the same name, then an error will be returned. This is true even if
* that index is out of date.
*
* The default is true
* The default is false
*/
replace?: boolean;