sekejap 0.15.0 → 0.16.1
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/index.d.ts
CHANGED
|
@@ -35,6 +35,89 @@ export declare class Db {
|
|
|
35
35
|
edgeCount(): number
|
|
36
36
|
/** Compact: truncate WAL, rewrite payloads/topology, reclaim RAM. */
|
|
37
37
|
compact(): void
|
|
38
|
+
/**
|
|
39
|
+
* Open an existing database in paged mode: identity/topology served from
|
|
40
|
+
* memory-mapped files — small open time and resident memory at any size.
|
|
41
|
+
*/
|
|
42
|
+
static openPaged(path: string): Db
|
|
43
|
+
/** Open an existing database read-only. */
|
|
44
|
+
static openReadOnly(path: string): Db
|
|
45
|
+
/** A node's raw JSON payload, or null. */
|
|
46
|
+
get(slug: string): string | null
|
|
47
|
+
/** True if the node exists. */
|
|
48
|
+
contains(slug: string): boolean
|
|
49
|
+
/** Delete a node (and its edges). */
|
|
50
|
+
remove(slug: string): void
|
|
51
|
+
/**
|
|
52
|
+
* Store many nodes in one batch (single disk sync).
|
|
53
|
+
* `pairsJson` is a JSON array of `[slug, payloadJson]` pairs.
|
|
54
|
+
*/
|
|
55
|
+
putMany(pairsJson: string): number
|
|
56
|
+
/** Begin a bulk-load scope (defer the per-write disk sync). Pair with `endBulk`. */
|
|
57
|
+
beginBulk(): void
|
|
58
|
+
/** End a bulk-load scope: one disk sync for the whole batch. */
|
|
59
|
+
endBulk(): void
|
|
60
|
+
/** Store an embedding under a named field of a node. */
|
|
61
|
+
putVector(slug: string, field: string, data: Array<number>): void
|
|
62
|
+
/** The stored embedding for a node's field, or null. */
|
|
63
|
+
getVector(slug: string, field: string): Array<number> | null
|
|
64
|
+
/** Create an edge with JSON attributes (primitives ride fast columns). */
|
|
65
|
+
linkMeta(from: string, to: string, edgeType: string, metaJson: string): void
|
|
66
|
+
/**
|
|
67
|
+
* Create many edges in one batch (single disk sync).
|
|
68
|
+
* `edgesJson` is a JSON array of `[from, to, edgeType]` triples.
|
|
69
|
+
*/
|
|
70
|
+
linkMany(edgesJson: string): void
|
|
71
|
+
/** Remove a directed edge. */
|
|
72
|
+
unlink(from: string, to: string, edgeType: string): void
|
|
73
|
+
/**
|
|
74
|
+
* Remove edges matching attribute equality conditions (`propsJson` is a
|
|
75
|
+
* JSON object). Returns how many were removed.
|
|
76
|
+
*/
|
|
77
|
+
unlinkWhere(from: string, to: string, edgeType: string, propsJson: string): number
|
|
78
|
+
/**
|
|
79
|
+
* Update attributes on matching edges: `propsJson` selects, `setsJson`
|
|
80
|
+
* assigns. Returns how many were updated.
|
|
81
|
+
*/
|
|
82
|
+
updateEdge(from: string, to: string, edgeType: string, propsJson: string, setsJson: string): number
|
|
83
|
+
/**
|
|
84
|
+
* Edges leaving a node, as a JSON-array string of
|
|
85
|
+
* `{from, to, type, meta}` objects.
|
|
86
|
+
*/
|
|
87
|
+
edgesFrom(slug: string): string
|
|
88
|
+
/** Edges arriving at a node, same shape as `edgesFrom`. */
|
|
89
|
+
edgesTo(slug: string): string
|
|
90
|
+
/** Edges from one collection to another, same shape as `edgesFrom`. */
|
|
91
|
+
edgesBetween(fromCollection: string, toCollection: string): string
|
|
92
|
+
/** All collection names. */
|
|
93
|
+
collectionNames(): Array<string>
|
|
94
|
+
/** Every node slug. */
|
|
95
|
+
allSlugs(): Array<string>
|
|
96
|
+
/** DDL string for a collection schema, or null. */
|
|
97
|
+
schemaDdl(collection: string): string | null
|
|
98
|
+
/**
|
|
99
|
+
* Ranked text search over a BM25-indexed field: JSON-array string of
|
|
100
|
+
* `[slug, score]` pairs, best first.
|
|
101
|
+
*/
|
|
102
|
+
bm25Search(field: string, query: string, topK: number): string
|
|
103
|
+
/**
|
|
104
|
+
* The query plan for a statement, as a JSON-array string (one step per
|
|
105
|
+
* element). `analyze = true` also executes it and adds per-step timings.
|
|
106
|
+
*/
|
|
107
|
+
explain(sql: string, analyze?: boolean | undefined | null): string
|
|
108
|
+
/** Run a SHOW statement (`SHOW TABLES`, `SHOW EDGES`, …); JSON-array string. */
|
|
109
|
+
show(sql: string): string
|
|
110
|
+
/** Shrink resident memory to the live working set (never drops indexes). */
|
|
111
|
+
trimMemory(): void
|
|
112
|
+
/** Per-structure resident-memory estimate, as a JSON object string. */
|
|
113
|
+
memoryReport(): string
|
|
114
|
+
/** Override HNSW search breadth (`efSearch`); null restores the default. */
|
|
115
|
+
setHnswEfSearch(ef?: number | undefined | null): void
|
|
116
|
+
/**
|
|
117
|
+
* Close the database and release its lock. Further calls error (or no-op
|
|
118
|
+
* for count/list getters). Safe to call twice.
|
|
119
|
+
*/
|
|
120
|
+
close(): void
|
|
38
121
|
}
|
|
39
122
|
/** A prepared (compiled) query — from `Db.prepare`, run with `Db.queryPrepared`. */
|
|
40
123
|
export declare class PreparedStatement { }
|
package/package.json
CHANGED
|
Binary file
|
package/sekejap.darwin-x64.node
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|