@liorandb/core 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -37,30 +37,28 @@ declare class Collection<T = any> {
37
37
  private validate;
38
38
  private _enqueue;
39
39
  close(): Promise<void>;
40
+ compact(): Promise<void>;
40
41
  _exec(op: string, args: any[]): Promise<any>;
41
- insertOne(doc: T & {
42
- _id?: string;
43
- }): Promise<any>;
44
- insertMany(docs?: (T & {
45
- _id?: string;
46
- })[]): Promise<any>;
47
- find(query?: any): Promise<any>;
48
- findOne(query?: any): Promise<any>;
49
- updateOne(filter: any, update: any, options?: UpdateOptions$1): Promise<any>;
50
- updateMany(filter: any, update: any): Promise<any>;
51
- deleteOne(filter: any): Promise<any>;
52
- deleteMany(filter: any): Promise<any>;
53
- countDocuments(filter?: any): Promise<any>;
54
42
  private _updateIndexes;
55
43
  private _insertOne;
56
44
  private _insertMany;
45
+ private _getCandidateIds;
46
+ private _find;
57
47
  private _findOne;
48
+ private _countDocuments;
58
49
  private _updateOne;
59
50
  private _updateMany;
60
- private _find;
61
51
  private _deleteOne;
62
52
  private _deleteMany;
63
- private _countDocuments;
53
+ insertOne(doc: any): Promise<any>;
54
+ insertMany(docs: any[]): Promise<any>;
55
+ find(query?: any): Promise<any>;
56
+ findOne(query?: any): Promise<any>;
57
+ updateOne(filter: any, update: any, options?: UpdateOptions$1): Promise<any>;
58
+ updateMany(filter: any, update: any): Promise<any>;
59
+ deleteOne(filter: any): Promise<any>;
60
+ deleteMany(filter: any): Promise<any>;
61
+ countDocuments(filter?: any): Promise<any>;
64
62
  }
65
63
 
66
64
  type TXOp = {
@@ -104,6 +102,14 @@ declare class LioranDB {
104
102
  applyTransaction(ops: TXOp[]): Promise<void>;
105
103
  collection<T = any>(name: string, schema?: ZodSchema<T>): Collection<T>;
106
104
  createIndex(collection: string, field: string, options?: IndexOptions): Promise<void>;
105
+ /**
106
+ * Compact single collection safely (WAL + TX safe)
107
+ */
108
+ compactCollection(name: string): Promise<void>;
109
+ /**
110
+ * Compact entire database safely
111
+ */
112
+ compactAll(): Promise<void>;
107
113
  transaction<T>(fn: (tx: DBTransactionContext) => Promise<T>): Promise<T>;
108
114
  close(): Promise<void>;
109
115
  }