@yydb/light-db 0.0.0
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/api/LightDB.d.ts +194 -0
- package/dist/api/LightDB.d.ts.map +1 -0
- package/dist/api/LightDB.js +299 -0
- package/dist/api/LightDB.js.map +1 -0
- package/dist/api/Transaction.d.ts +100 -0
- package/dist/api/Transaction.d.ts.map +1 -0
- package/dist/api/Transaction.js +263 -0
- package/dist/api/Transaction.js.map +1 -0
- package/dist/api/index.d.ts +24 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +54 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/types.d.ts +154 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +7 -0
- package/dist/api/types.js.map +1 -0
- package/dist/collection/Collection.d.ts +235 -0
- package/dist/collection/Collection.d.ts.map +1 -0
- package/dist/collection/Collection.js +671 -0
- package/dist/collection/Collection.js.map +1 -0
- package/dist/collection/QueryBuilder.d.ts +225 -0
- package/dist/collection/QueryBuilder.d.ts.map +1 -0
- package/dist/collection/QueryBuilder.js +475 -0
- package/dist/collection/QueryBuilder.js.map +1 -0
- package/dist/collection/QueryParser.d.ts +117 -0
- package/dist/collection/QueryParser.d.ts.map +1 -0
- package/dist/collection/QueryParser.js +438 -0
- package/dist/collection/QueryParser.js.map +1 -0
- package/dist/collection/index.d.ts +42 -0
- package/dist/collection/index.d.ts.map +1 -0
- package/dist/collection/index.js +41 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/types.d.ts +365 -0
- package/dist/collection/types.d.ts.map +1 -0
- package/dist/collection/types.js +7 -0
- package/dist/collection/types.js.map +1 -0
- package/dist/constants/index.d.ts +51 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +68 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/errors/index.d.ts +69 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +132 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +220 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +729 -0
- package/dist/index.js.map +1 -0
- package/dist/indexes/BPlusTree.d.ts +181 -0
- package/dist/indexes/BPlusTree.d.ts.map +1 -0
- package/dist/indexes/BPlusTree.js +528 -0
- package/dist/indexes/BPlusTree.js.map +1 -0
- package/dist/indexes/IndexManager.d.ts +236 -0
- package/dist/indexes/IndexManager.d.ts.map +1 -0
- package/dist/indexes/IndexManager.js +502 -0
- package/dist/indexes/IndexManager.js.map +1 -0
- package/dist/indexes/PrimaryIndex.d.ts +240 -0
- package/dist/indexes/PrimaryIndex.d.ts.map +1 -0
- package/dist/indexes/PrimaryIndex.js +354 -0
- package/dist/indexes/PrimaryIndex.js.map +1 -0
- package/dist/indexes/SecondaryIndex.d.ts +204 -0
- package/dist/indexes/SecondaryIndex.d.ts.map +1 -0
- package/dist/indexes/SecondaryIndex.js +480 -0
- package/dist/indexes/SecondaryIndex.js.map +1 -0
- package/dist/indexes/errors.d.ts +66 -0
- package/dist/indexes/errors.d.ts.map +1 -0
- package/dist/indexes/errors.js +117 -0
- package/dist/indexes/errors.js.map +1 -0
- package/dist/indexes/index.d.ts +52 -0
- package/dist/indexes/index.d.ts.map +1 -0
- package/dist/indexes/index.js +131 -0
- package/dist/indexes/index.js.map +1 -0
- package/dist/indexes/types.d.ts +246 -0
- package/dist/indexes/types.d.ts.map +1 -0
- package/dist/indexes/types.js +30 -0
- package/dist/indexes/types.js.map +1 -0
- package/dist/performance/BatchWALWriter.d.ts +185 -0
- package/dist/performance/BatchWALWriter.d.ts.map +1 -0
- package/dist/performance/BatchWALWriter.js +490 -0
- package/dist/performance/BatchWALWriter.js.map +1 -0
- package/dist/performance/ColumnarStorage.d.ts +138 -0
- package/dist/performance/ColumnarStorage.d.ts.map +1 -0
- package/dist/performance/ColumnarStorage.js +875 -0
- package/dist/performance/ColumnarStorage.js.map +1 -0
- package/dist/performance/LazyQuery.d.ts +307 -0
- package/dist/performance/LazyQuery.d.ts.map +1 -0
- package/dist/performance/LazyQuery.js +588 -0
- package/dist/performance/LazyQuery.js.map +1 -0
- package/dist/performance/OptimizedBuffer.d.ts +375 -0
- package/dist/performance/OptimizedBuffer.d.ts.map +1 -0
- package/dist/performance/OptimizedBuffer.js +730 -0
- package/dist/performance/OptimizedBuffer.js.map +1 -0
- package/dist/performance/RWLock.d.ts +260 -0
- package/dist/performance/RWLock.d.ts.map +1 -0
- package/dist/performance/RWLock.js +570 -0
- package/dist/performance/RWLock.js.map +1 -0
- package/dist/performance/index.d.ts +41 -0
- package/dist/performance/index.d.ts.map +1 -0
- package/dist/performance/index.js +162 -0
- package/dist/performance/index.js.map +1 -0
- package/dist/performance/types.d.ts +247 -0
- package/dist/performance/types.d.ts.map +1 -0
- package/dist/performance/types.js +26 -0
- package/dist/performance/types.js.map +1 -0
- package/dist/storage/Checkpoint.d.ts +128 -0
- package/dist/storage/Checkpoint.d.ts.map +1 -0
- package/dist/storage/Checkpoint.js +251 -0
- package/dist/storage/Checkpoint.js.map +1 -0
- package/dist/storage/LightFile.d.ts +227 -0
- package/dist/storage/LightFile.d.ts.map +1 -0
- package/dist/storage/LightFile.js +526 -0
- package/dist/storage/LightFile.js.map +1 -0
- package/dist/storage/Recovery.d.ts +172 -0
- package/dist/storage/Recovery.d.ts.map +1 -0
- package/dist/storage/Recovery.js +399 -0
- package/dist/storage/Recovery.js.map +1 -0
- package/dist/storage/SHMFile.d.ts +243 -0
- package/dist/storage/SHMFile.d.ts.map +1 -0
- package/dist/storage/SHMFile.js +436 -0
- package/dist/storage/SHMFile.js.map +1 -0
- package/dist/storage/StorageEngine.d.ts +146 -0
- package/dist/storage/StorageEngine.d.ts.map +1 -0
- package/dist/storage/StorageEngine.js +353 -0
- package/dist/storage/StorageEngine.js.map +1 -0
- package/dist/storage/WALFile.d.ts +248 -0
- package/dist/storage/WALFile.d.ts.map +1 -0
- package/dist/storage/WALFile.js +597 -0
- package/dist/storage/WALFile.js.map +1 -0
- package/dist/storage/index.d.ts +10 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +153 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/types/index.d.ts +220 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/binary.d.ts +271 -0
- package/dist/utils/binary.d.ts.map +1 -0
- package/dist/utils/binary.js +454 -0
- package/dist/utils/binary.js.map +1 -0
- package/dist/utils/file.d.ts +166 -0
- package/dist/utils/file.d.ts.map +1 -0
- package/dist/utils/file.js +346 -0
- package/dist/utils/file.js.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +39 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +37 -0
- package/readme.md +124 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,729 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* LightDB 存储引擎
|
|
4
|
+
*
|
|
5
|
+
* 这是一个高性能的 TypeScript 数据库存储层实现。
|
|
6
|
+
* 提供完整的 WAL(预写日志)、检查点、崩溃恢复和索引管理功能。
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.BPlusTreeNodeType =
|
|
12
|
+
exports.IndexType =
|
|
13
|
+
exports.createStorageEngine =
|
|
14
|
+
exports.StorageEngine =
|
|
15
|
+
exports.RecoveryPhase =
|
|
16
|
+
exports.RecoveryValidator =
|
|
17
|
+
exports.FastRecoveryManager =
|
|
18
|
+
exports.RecoveryManager =
|
|
19
|
+
exports.IncrementalCheckpointManager =
|
|
20
|
+
exports.AutoCheckpointScheduler =
|
|
21
|
+
exports.CheckpointManager =
|
|
22
|
+
exports.WalIndexManager =
|
|
23
|
+
exports.ShmFileManager =
|
|
24
|
+
exports.ShmHashTable =
|
|
25
|
+
exports.ShmSerializer =
|
|
26
|
+
exports.WalManager =
|
|
27
|
+
exports.WalReader =
|
|
28
|
+
exports.WalWriter =
|
|
29
|
+
exports.WalRecordSerializer =
|
|
30
|
+
exports.PageManager =
|
|
31
|
+
exports.LightFileManager =
|
|
32
|
+
exports.LightFileSerializer =
|
|
33
|
+
exports.FileHandleWrapper =
|
|
34
|
+
exports.FileUtils =
|
|
35
|
+
exports.BufferReader =
|
|
36
|
+
exports.BufferWriter =
|
|
37
|
+
exports.BinaryUtils =
|
|
38
|
+
exports.ConfigurationError =
|
|
39
|
+
exports.SerializationError =
|
|
40
|
+
exports.PageError =
|
|
41
|
+
exports.CheckpointError =
|
|
42
|
+
exports.RecoveryError =
|
|
43
|
+
exports.WalError =
|
|
44
|
+
exports.ChecksumError =
|
|
45
|
+
exports.FileFormatError =
|
|
46
|
+
exports.FileOperationError =
|
|
47
|
+
exports.StorageError =
|
|
48
|
+
exports.FILE_EXTENSIONS =
|
|
49
|
+
exports.OperationType =
|
|
50
|
+
exports.PAGE_HEADER_SIZE =
|
|
51
|
+
exports.SHM_DEFAULT_CAPACITY =
|
|
52
|
+
exports.SHM_ENTRY_SIZE =
|
|
53
|
+
exports.SHM_HEADER_SIZE =
|
|
54
|
+
exports.WAL_RECORD_HEADER_SIZE =
|
|
55
|
+
exports.HEADER_SIZE =
|
|
56
|
+
exports.DEFAULT_WAL_THRESHOLD =
|
|
57
|
+
exports.DEFAULT_PAGE_SIZE =
|
|
58
|
+
exports.LIGHT_VERSION =
|
|
59
|
+
exports.LIGHT_MAGIC_STRING =
|
|
60
|
+
exports.LIGHT_MAGIC =
|
|
61
|
+
void 0;
|
|
62
|
+
exports.GeneratorUtils =
|
|
63
|
+
exports.lazyIterator =
|
|
64
|
+
exports.lazy =
|
|
65
|
+
exports.LazyQueryBuilder =
|
|
66
|
+
exports.LazyQueryIterator =
|
|
67
|
+
exports.ReentrantRWLock =
|
|
68
|
+
exports.RWLockManager =
|
|
69
|
+
exports.RWLock =
|
|
70
|
+
exports.WriteLockHandle =
|
|
71
|
+
exports.ReadLockHandle =
|
|
72
|
+
exports.BatchWriteManager =
|
|
73
|
+
exports.BatchWalWriter =
|
|
74
|
+
exports.BufferConcatenator =
|
|
75
|
+
exports.FastSerializer =
|
|
76
|
+
exports.OptimizedBufferReader =
|
|
77
|
+
exports.OptimizedBufferWriter =
|
|
78
|
+
exports.getGlobalBufferPool =
|
|
79
|
+
exports.BufferPool =
|
|
80
|
+
exports.ColumnarStorage =
|
|
81
|
+
exports.ColumnType =
|
|
82
|
+
exports.openDatabase =
|
|
83
|
+
exports.defineCollectionSchema =
|
|
84
|
+
exports.LightDB =
|
|
85
|
+
exports.TransactionManager =
|
|
86
|
+
exports.Transaction =
|
|
87
|
+
exports.TransactionError =
|
|
88
|
+
exports.CollectionError =
|
|
89
|
+
exports.Collection =
|
|
90
|
+
exports.QueryBuilder =
|
|
91
|
+
exports.QueryParser =
|
|
92
|
+
exports.IndexManager =
|
|
93
|
+
exports.SecondaryIndex =
|
|
94
|
+
exports.PrimaryIndex =
|
|
95
|
+
exports.BPlusTree =
|
|
96
|
+
exports.RangeQueryError =
|
|
97
|
+
exports.IndexConsistencyError =
|
|
98
|
+
exports.IndexOperationError =
|
|
99
|
+
exports.IndexConfigError =
|
|
100
|
+
exports.IndexExistsError =
|
|
101
|
+
exports.IndexNotFoundError =
|
|
102
|
+
exports.KeyNotFoundError =
|
|
103
|
+
exports.DuplicateKeyError =
|
|
104
|
+
exports.IndexError =
|
|
105
|
+
void 0;
|
|
106
|
+
exports.openStorageEngine = openStorageEngine;
|
|
107
|
+
// 常量导出
|
|
108
|
+
var constants_1 = require("./constants");
|
|
109
|
+
Object.defineProperty(exports, "LIGHT_MAGIC", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: function () {
|
|
112
|
+
return constants_1.LIGHT_MAGIC;
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
Object.defineProperty(exports, "LIGHT_MAGIC_STRING", {
|
|
116
|
+
enumerable: true,
|
|
117
|
+
get: function () {
|
|
118
|
+
return constants_1.LIGHT_MAGIC_STRING;
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
Object.defineProperty(exports, "LIGHT_VERSION", {
|
|
122
|
+
enumerable: true,
|
|
123
|
+
get: function () {
|
|
124
|
+
return constants_1.LIGHT_VERSION;
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
Object.defineProperty(exports, "DEFAULT_PAGE_SIZE", {
|
|
128
|
+
enumerable: true,
|
|
129
|
+
get: function () {
|
|
130
|
+
return constants_1.DEFAULT_PAGE_SIZE;
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
Object.defineProperty(exports, "DEFAULT_WAL_THRESHOLD", {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
get: function () {
|
|
136
|
+
return constants_1.DEFAULT_WAL_THRESHOLD;
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
Object.defineProperty(exports, "HEADER_SIZE", {
|
|
140
|
+
enumerable: true,
|
|
141
|
+
get: function () {
|
|
142
|
+
return constants_1.HEADER_SIZE;
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
Object.defineProperty(exports, "WAL_RECORD_HEADER_SIZE", {
|
|
146
|
+
enumerable: true,
|
|
147
|
+
get: function () {
|
|
148
|
+
return constants_1.WAL_RECORD_HEADER_SIZE;
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
Object.defineProperty(exports, "SHM_HEADER_SIZE", {
|
|
152
|
+
enumerable: true,
|
|
153
|
+
get: function () {
|
|
154
|
+
return constants_1.SHM_HEADER_SIZE;
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
Object.defineProperty(exports, "SHM_ENTRY_SIZE", {
|
|
158
|
+
enumerable: true,
|
|
159
|
+
get: function () {
|
|
160
|
+
return constants_1.SHM_ENTRY_SIZE;
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
Object.defineProperty(exports, "SHM_DEFAULT_CAPACITY", {
|
|
164
|
+
enumerable: true,
|
|
165
|
+
get: function () {
|
|
166
|
+
return constants_1.SHM_DEFAULT_CAPACITY;
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
Object.defineProperty(exports, "PAGE_HEADER_SIZE", {
|
|
170
|
+
enumerable: true,
|
|
171
|
+
get: function () {
|
|
172
|
+
return constants_1.PAGE_HEADER_SIZE;
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
Object.defineProperty(exports, "OperationType", {
|
|
176
|
+
enumerable: true,
|
|
177
|
+
get: function () {
|
|
178
|
+
return constants_1.OperationType;
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
Object.defineProperty(exports, "FILE_EXTENSIONS", {
|
|
182
|
+
enumerable: true,
|
|
183
|
+
get: function () {
|
|
184
|
+
return constants_1.FILE_EXTENSIONS;
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
// 错误类导出
|
|
188
|
+
var errors_1 = require("./errors");
|
|
189
|
+
Object.defineProperty(exports, "StorageError", {
|
|
190
|
+
enumerable: true,
|
|
191
|
+
get: function () {
|
|
192
|
+
return errors_1.StorageError;
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
Object.defineProperty(exports, "FileOperationError", {
|
|
196
|
+
enumerable: true,
|
|
197
|
+
get: function () {
|
|
198
|
+
return errors_1.FileOperationError;
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
Object.defineProperty(exports, "FileFormatError", {
|
|
202
|
+
enumerable: true,
|
|
203
|
+
get: function () {
|
|
204
|
+
return errors_1.FileFormatError;
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
Object.defineProperty(exports, "ChecksumError", {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
get: function () {
|
|
210
|
+
return errors_1.ChecksumError;
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
Object.defineProperty(exports, "WalError", {
|
|
214
|
+
enumerable: true,
|
|
215
|
+
get: function () {
|
|
216
|
+
return errors_1.WalError;
|
|
217
|
+
},
|
|
218
|
+
});
|
|
219
|
+
Object.defineProperty(exports, "RecoveryError", {
|
|
220
|
+
enumerable: true,
|
|
221
|
+
get: function () {
|
|
222
|
+
return errors_1.RecoveryError;
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
Object.defineProperty(exports, "CheckpointError", {
|
|
226
|
+
enumerable: true,
|
|
227
|
+
get: function () {
|
|
228
|
+
return errors_1.CheckpointError;
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
Object.defineProperty(exports, "PageError", {
|
|
232
|
+
enumerable: true,
|
|
233
|
+
get: function () {
|
|
234
|
+
return errors_1.PageError;
|
|
235
|
+
},
|
|
236
|
+
});
|
|
237
|
+
Object.defineProperty(exports, "SerializationError", {
|
|
238
|
+
enumerable: true,
|
|
239
|
+
get: function () {
|
|
240
|
+
return errors_1.SerializationError;
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
Object.defineProperty(exports, "ConfigurationError", {
|
|
244
|
+
enumerable: true,
|
|
245
|
+
get: function () {
|
|
246
|
+
return errors_1.ConfigurationError;
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
// 工具类导出
|
|
250
|
+
var utils_1 = require("./utils");
|
|
251
|
+
Object.defineProperty(exports, "BinaryUtils", {
|
|
252
|
+
enumerable: true,
|
|
253
|
+
get: function () {
|
|
254
|
+
return utils_1.BinaryUtils;
|
|
255
|
+
},
|
|
256
|
+
});
|
|
257
|
+
Object.defineProperty(exports, "BufferWriter", {
|
|
258
|
+
enumerable: true,
|
|
259
|
+
get: function () {
|
|
260
|
+
return utils_1.BufferWriter;
|
|
261
|
+
},
|
|
262
|
+
});
|
|
263
|
+
Object.defineProperty(exports, "BufferReader", {
|
|
264
|
+
enumerable: true,
|
|
265
|
+
get: function () {
|
|
266
|
+
return utils_1.BufferReader;
|
|
267
|
+
},
|
|
268
|
+
});
|
|
269
|
+
Object.defineProperty(exports, "FileUtils", {
|
|
270
|
+
enumerable: true,
|
|
271
|
+
get: function () {
|
|
272
|
+
return utils_1.FileUtils;
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
Object.defineProperty(exports, "FileHandleWrapper", {
|
|
276
|
+
enumerable: true,
|
|
277
|
+
get: function () {
|
|
278
|
+
return utils_1.FileHandleWrapper;
|
|
279
|
+
},
|
|
280
|
+
});
|
|
281
|
+
// 存储组件导出
|
|
282
|
+
var storage_1 = require("./storage");
|
|
283
|
+
Object.defineProperty(exports, "LightFileSerializer", {
|
|
284
|
+
enumerable: true,
|
|
285
|
+
get: function () {
|
|
286
|
+
return storage_1.LightFileSerializer;
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
Object.defineProperty(exports, "LightFileManager", {
|
|
290
|
+
enumerable: true,
|
|
291
|
+
get: function () {
|
|
292
|
+
return storage_1.LightFileManager;
|
|
293
|
+
},
|
|
294
|
+
});
|
|
295
|
+
Object.defineProperty(exports, "PageManager", {
|
|
296
|
+
enumerable: true,
|
|
297
|
+
get: function () {
|
|
298
|
+
return storage_1.PageManager;
|
|
299
|
+
},
|
|
300
|
+
});
|
|
301
|
+
var storage_2 = require("./storage");
|
|
302
|
+
Object.defineProperty(exports, "WalRecordSerializer", {
|
|
303
|
+
enumerable: true,
|
|
304
|
+
get: function () {
|
|
305
|
+
return storage_2.WalRecordSerializer;
|
|
306
|
+
},
|
|
307
|
+
});
|
|
308
|
+
Object.defineProperty(exports, "WalWriter", {
|
|
309
|
+
enumerable: true,
|
|
310
|
+
get: function () {
|
|
311
|
+
return storage_2.WalWriter;
|
|
312
|
+
},
|
|
313
|
+
});
|
|
314
|
+
Object.defineProperty(exports, "WalReader", {
|
|
315
|
+
enumerable: true,
|
|
316
|
+
get: function () {
|
|
317
|
+
return storage_2.WalReader;
|
|
318
|
+
},
|
|
319
|
+
});
|
|
320
|
+
Object.defineProperty(exports, "WalManager", {
|
|
321
|
+
enumerable: true,
|
|
322
|
+
get: function () {
|
|
323
|
+
return storage_2.WalManager;
|
|
324
|
+
},
|
|
325
|
+
});
|
|
326
|
+
var storage_3 = require("./storage");
|
|
327
|
+
Object.defineProperty(exports, "ShmSerializer", {
|
|
328
|
+
enumerable: true,
|
|
329
|
+
get: function () {
|
|
330
|
+
return storage_3.ShmSerializer;
|
|
331
|
+
},
|
|
332
|
+
});
|
|
333
|
+
Object.defineProperty(exports, "ShmHashTable", {
|
|
334
|
+
enumerable: true,
|
|
335
|
+
get: function () {
|
|
336
|
+
return storage_3.ShmHashTable;
|
|
337
|
+
},
|
|
338
|
+
});
|
|
339
|
+
Object.defineProperty(exports, "ShmFileManager", {
|
|
340
|
+
enumerable: true,
|
|
341
|
+
get: function () {
|
|
342
|
+
return storage_3.ShmFileManager;
|
|
343
|
+
},
|
|
344
|
+
});
|
|
345
|
+
Object.defineProperty(exports, "WalIndexManager", {
|
|
346
|
+
enumerable: true,
|
|
347
|
+
get: function () {
|
|
348
|
+
return storage_3.WalIndexManager;
|
|
349
|
+
},
|
|
350
|
+
});
|
|
351
|
+
var storage_4 = require("./storage");
|
|
352
|
+
Object.defineProperty(exports, "CheckpointManager", {
|
|
353
|
+
enumerable: true,
|
|
354
|
+
get: function () {
|
|
355
|
+
return storage_4.CheckpointManager;
|
|
356
|
+
},
|
|
357
|
+
});
|
|
358
|
+
Object.defineProperty(exports, "AutoCheckpointScheduler", {
|
|
359
|
+
enumerable: true,
|
|
360
|
+
get: function () {
|
|
361
|
+
return storage_4.AutoCheckpointScheduler;
|
|
362
|
+
},
|
|
363
|
+
});
|
|
364
|
+
Object.defineProperty(exports, "IncrementalCheckpointManager", {
|
|
365
|
+
enumerable: true,
|
|
366
|
+
get: function () {
|
|
367
|
+
return storage_4.IncrementalCheckpointManager;
|
|
368
|
+
},
|
|
369
|
+
});
|
|
370
|
+
var storage_5 = require("./storage");
|
|
371
|
+
Object.defineProperty(exports, "RecoveryManager", {
|
|
372
|
+
enumerable: true,
|
|
373
|
+
get: function () {
|
|
374
|
+
return storage_5.RecoveryManager;
|
|
375
|
+
},
|
|
376
|
+
});
|
|
377
|
+
Object.defineProperty(exports, "FastRecoveryManager", {
|
|
378
|
+
enumerable: true,
|
|
379
|
+
get: function () {
|
|
380
|
+
return storage_5.FastRecoveryManager;
|
|
381
|
+
},
|
|
382
|
+
});
|
|
383
|
+
Object.defineProperty(exports, "RecoveryValidator", {
|
|
384
|
+
enumerable: true,
|
|
385
|
+
get: function () {
|
|
386
|
+
return storage_5.RecoveryValidator;
|
|
387
|
+
},
|
|
388
|
+
});
|
|
389
|
+
Object.defineProperty(exports, "RecoveryPhase", {
|
|
390
|
+
enumerable: true,
|
|
391
|
+
get: function () {
|
|
392
|
+
return storage_5.RecoveryPhase;
|
|
393
|
+
},
|
|
394
|
+
});
|
|
395
|
+
var storage_6 = require("./storage");
|
|
396
|
+
Object.defineProperty(exports, "StorageEngine", {
|
|
397
|
+
enumerable: true,
|
|
398
|
+
get: function () {
|
|
399
|
+
return storage_6.StorageEngine;
|
|
400
|
+
},
|
|
401
|
+
});
|
|
402
|
+
Object.defineProperty(exports, "createStorageEngine", {
|
|
403
|
+
enumerable: true,
|
|
404
|
+
get: function () {
|
|
405
|
+
return storage_6.createStorageEngine;
|
|
406
|
+
},
|
|
407
|
+
});
|
|
408
|
+
const storage_7 = require("./storage");
|
|
409
|
+
/**
|
|
410
|
+
* 打开存储引擎
|
|
411
|
+
*
|
|
412
|
+
* @param basePath - 数据库文件存储路径
|
|
413
|
+
* @param dbName - 数据库名称
|
|
414
|
+
* @param options - 配置选项
|
|
415
|
+
* @returns 初始化完成的存储引擎实例
|
|
416
|
+
*
|
|
417
|
+
* @example
|
|
418
|
+
* ```typescript
|
|
419
|
+
* import { openStorageEngine } from '@yydb/light-db';
|
|
420
|
+
*
|
|
421
|
+
* const engine = await openStorageEngine('./data', 'mydb', {
|
|
422
|
+
* pageSize: 4096,
|
|
423
|
+
* walThreshold: 16 * 1024 * 1024,
|
|
424
|
+
* autoCheckpoint: true
|
|
425
|
+
* });
|
|
426
|
+
*
|
|
427
|
+
* // 插入数据
|
|
428
|
+
* await engine.insert('key1', Buffer.from('value1'));
|
|
429
|
+
*
|
|
430
|
+
* // 读取数据
|
|
431
|
+
* const value = await engine.get('key1');
|
|
432
|
+
*
|
|
433
|
+
* // 关闭引擎
|
|
434
|
+
* await engine.close();
|
|
435
|
+
* ```
|
|
436
|
+
*/
|
|
437
|
+
async function openStorageEngine(basePath, dbName, options) {
|
|
438
|
+
return (0, storage_7.createStorageEngine)(basePath, dbName, options);
|
|
439
|
+
}
|
|
440
|
+
// 索引引擎导出
|
|
441
|
+
var indexes_1 = require("./indexes");
|
|
442
|
+
Object.defineProperty(exports, "IndexType", {
|
|
443
|
+
enumerable: true,
|
|
444
|
+
get: function () {
|
|
445
|
+
return indexes_1.IndexType;
|
|
446
|
+
},
|
|
447
|
+
});
|
|
448
|
+
Object.defineProperty(exports, "BPlusTreeNodeType", {
|
|
449
|
+
enumerable: true,
|
|
450
|
+
get: function () {
|
|
451
|
+
return indexes_1.BPlusTreeNodeType;
|
|
452
|
+
},
|
|
453
|
+
});
|
|
454
|
+
var indexes_2 = require("./indexes");
|
|
455
|
+
Object.defineProperty(exports, "IndexError", {
|
|
456
|
+
enumerable: true,
|
|
457
|
+
get: function () {
|
|
458
|
+
return indexes_2.IndexError;
|
|
459
|
+
},
|
|
460
|
+
});
|
|
461
|
+
Object.defineProperty(exports, "DuplicateKeyError", {
|
|
462
|
+
enumerable: true,
|
|
463
|
+
get: function () {
|
|
464
|
+
return indexes_2.DuplicateKeyError;
|
|
465
|
+
},
|
|
466
|
+
});
|
|
467
|
+
Object.defineProperty(exports, "KeyNotFoundError", {
|
|
468
|
+
enumerable: true,
|
|
469
|
+
get: function () {
|
|
470
|
+
return indexes_2.KeyNotFoundError;
|
|
471
|
+
},
|
|
472
|
+
});
|
|
473
|
+
Object.defineProperty(exports, "IndexNotFoundError", {
|
|
474
|
+
enumerable: true,
|
|
475
|
+
get: function () {
|
|
476
|
+
return indexes_2.IndexNotFoundError;
|
|
477
|
+
},
|
|
478
|
+
});
|
|
479
|
+
Object.defineProperty(exports, "IndexExistsError", {
|
|
480
|
+
enumerable: true,
|
|
481
|
+
get: function () {
|
|
482
|
+
return indexes_2.IndexExistsError;
|
|
483
|
+
},
|
|
484
|
+
});
|
|
485
|
+
Object.defineProperty(exports, "IndexConfigError", {
|
|
486
|
+
enumerable: true,
|
|
487
|
+
get: function () {
|
|
488
|
+
return indexes_2.IndexConfigError;
|
|
489
|
+
},
|
|
490
|
+
});
|
|
491
|
+
Object.defineProperty(exports, "IndexOperationError", {
|
|
492
|
+
enumerable: true,
|
|
493
|
+
get: function () {
|
|
494
|
+
return indexes_2.IndexOperationError;
|
|
495
|
+
},
|
|
496
|
+
});
|
|
497
|
+
Object.defineProperty(exports, "IndexConsistencyError", {
|
|
498
|
+
enumerable: true,
|
|
499
|
+
get: function () {
|
|
500
|
+
return indexes_2.IndexConsistencyError;
|
|
501
|
+
},
|
|
502
|
+
});
|
|
503
|
+
Object.defineProperty(exports, "RangeQueryError", {
|
|
504
|
+
enumerable: true,
|
|
505
|
+
get: function () {
|
|
506
|
+
return indexes_2.RangeQueryError;
|
|
507
|
+
},
|
|
508
|
+
});
|
|
509
|
+
var indexes_3 = require("./indexes");
|
|
510
|
+
Object.defineProperty(exports, "BPlusTree", {
|
|
511
|
+
enumerable: true,
|
|
512
|
+
get: function () {
|
|
513
|
+
return indexes_3.BPlusTree;
|
|
514
|
+
},
|
|
515
|
+
});
|
|
516
|
+
var indexes_4 = require("./indexes");
|
|
517
|
+
Object.defineProperty(exports, "PrimaryIndex", {
|
|
518
|
+
enumerable: true,
|
|
519
|
+
get: function () {
|
|
520
|
+
return indexes_4.PrimaryIndex;
|
|
521
|
+
},
|
|
522
|
+
});
|
|
523
|
+
var indexes_5 = require("./indexes");
|
|
524
|
+
Object.defineProperty(exports, "SecondaryIndex", {
|
|
525
|
+
enumerable: true,
|
|
526
|
+
get: function () {
|
|
527
|
+
return indexes_5.SecondaryIndex;
|
|
528
|
+
},
|
|
529
|
+
});
|
|
530
|
+
var indexes_6 = require("./indexes");
|
|
531
|
+
Object.defineProperty(exports, "IndexManager", {
|
|
532
|
+
enumerable: true,
|
|
533
|
+
get: function () {
|
|
534
|
+
return indexes_6.IndexManager;
|
|
535
|
+
},
|
|
536
|
+
});
|
|
537
|
+
var collection_1 = require("./collection");
|
|
538
|
+
Object.defineProperty(exports, "QueryParser", {
|
|
539
|
+
enumerable: true,
|
|
540
|
+
get: function () {
|
|
541
|
+
return collection_1.QueryParser;
|
|
542
|
+
},
|
|
543
|
+
});
|
|
544
|
+
var collection_2 = require("./collection");
|
|
545
|
+
Object.defineProperty(exports, "QueryBuilder", {
|
|
546
|
+
enumerable: true,
|
|
547
|
+
get: function () {
|
|
548
|
+
return collection_2.QueryBuilder;
|
|
549
|
+
},
|
|
550
|
+
});
|
|
551
|
+
var collection_3 = require("./collection");
|
|
552
|
+
Object.defineProperty(exports, "Collection", {
|
|
553
|
+
enumerable: true,
|
|
554
|
+
get: function () {
|
|
555
|
+
return collection_3.Collection;
|
|
556
|
+
},
|
|
557
|
+
});
|
|
558
|
+
Object.defineProperty(exports, "CollectionError", {
|
|
559
|
+
enumerable: true,
|
|
560
|
+
get: function () {
|
|
561
|
+
return collection_3.CollectionError;
|
|
562
|
+
},
|
|
563
|
+
});
|
|
564
|
+
var api_1 = require("./api");
|
|
565
|
+
Object.defineProperty(exports, "TransactionError", {
|
|
566
|
+
enumerable: true,
|
|
567
|
+
get: function () {
|
|
568
|
+
return api_1.TransactionError;
|
|
569
|
+
},
|
|
570
|
+
});
|
|
571
|
+
Object.defineProperty(exports, "Transaction", {
|
|
572
|
+
enumerable: true,
|
|
573
|
+
get: function () {
|
|
574
|
+
return api_1.Transaction;
|
|
575
|
+
},
|
|
576
|
+
});
|
|
577
|
+
Object.defineProperty(exports, "TransactionManager", {
|
|
578
|
+
enumerable: true,
|
|
579
|
+
get: function () {
|
|
580
|
+
return api_1.TransactionManager;
|
|
581
|
+
},
|
|
582
|
+
});
|
|
583
|
+
var api_2 = require("./api");
|
|
584
|
+
Object.defineProperty(exports, "LightDB", {
|
|
585
|
+
enumerable: true,
|
|
586
|
+
get: function () {
|
|
587
|
+
return api_2.LightDB;
|
|
588
|
+
},
|
|
589
|
+
});
|
|
590
|
+
Object.defineProperty(exports, "defineCollectionSchema", {
|
|
591
|
+
enumerable: true,
|
|
592
|
+
get: function () {
|
|
593
|
+
return api_2.defineCollectionSchema;
|
|
594
|
+
},
|
|
595
|
+
});
|
|
596
|
+
Object.defineProperty(exports, "openDatabase", {
|
|
597
|
+
enumerable: true,
|
|
598
|
+
get: function () {
|
|
599
|
+
return api_2.openDatabase;
|
|
600
|
+
},
|
|
601
|
+
});
|
|
602
|
+
// 性能优化模块导出
|
|
603
|
+
var performance_1 = require("./performance");
|
|
604
|
+
Object.defineProperty(exports, "ColumnType", {
|
|
605
|
+
enumerable: true,
|
|
606
|
+
get: function () {
|
|
607
|
+
return performance_1.ColumnType;
|
|
608
|
+
},
|
|
609
|
+
});
|
|
610
|
+
var performance_2 = require("./performance");
|
|
611
|
+
Object.defineProperty(exports, "ColumnarStorage", {
|
|
612
|
+
enumerable: true,
|
|
613
|
+
get: function () {
|
|
614
|
+
return performance_2.ColumnarStorage;
|
|
615
|
+
},
|
|
616
|
+
});
|
|
617
|
+
var performance_3 = require("./performance");
|
|
618
|
+
Object.defineProperty(exports, "BufferPool", {
|
|
619
|
+
enumerable: true,
|
|
620
|
+
get: function () {
|
|
621
|
+
return performance_3.BufferPool;
|
|
622
|
+
},
|
|
623
|
+
});
|
|
624
|
+
Object.defineProperty(exports, "getGlobalBufferPool", {
|
|
625
|
+
enumerable: true,
|
|
626
|
+
get: function () {
|
|
627
|
+
return performance_3.getGlobalBufferPool;
|
|
628
|
+
},
|
|
629
|
+
});
|
|
630
|
+
Object.defineProperty(exports, "OptimizedBufferWriter", {
|
|
631
|
+
enumerable: true,
|
|
632
|
+
get: function () {
|
|
633
|
+
return performance_3.OptimizedBufferWriter;
|
|
634
|
+
},
|
|
635
|
+
});
|
|
636
|
+
Object.defineProperty(exports, "OptimizedBufferReader", {
|
|
637
|
+
enumerable: true,
|
|
638
|
+
get: function () {
|
|
639
|
+
return performance_3.OptimizedBufferReader;
|
|
640
|
+
},
|
|
641
|
+
});
|
|
642
|
+
Object.defineProperty(exports, "FastSerializer", {
|
|
643
|
+
enumerable: true,
|
|
644
|
+
get: function () {
|
|
645
|
+
return performance_3.FastSerializer;
|
|
646
|
+
},
|
|
647
|
+
});
|
|
648
|
+
Object.defineProperty(exports, "BufferConcatenator", {
|
|
649
|
+
enumerable: true,
|
|
650
|
+
get: function () {
|
|
651
|
+
return performance_3.BufferConcatenator;
|
|
652
|
+
},
|
|
653
|
+
});
|
|
654
|
+
var performance_4 = require("./performance");
|
|
655
|
+
Object.defineProperty(exports, "BatchWalWriter", {
|
|
656
|
+
enumerable: true,
|
|
657
|
+
get: function () {
|
|
658
|
+
return performance_4.BatchWalWriter;
|
|
659
|
+
},
|
|
660
|
+
});
|
|
661
|
+
Object.defineProperty(exports, "BatchWriteManager", {
|
|
662
|
+
enumerable: true,
|
|
663
|
+
get: function () {
|
|
664
|
+
return performance_4.BatchWriteManager;
|
|
665
|
+
},
|
|
666
|
+
});
|
|
667
|
+
var performance_5 = require("./performance");
|
|
668
|
+
Object.defineProperty(exports, "ReadLockHandle", {
|
|
669
|
+
enumerable: true,
|
|
670
|
+
get: function () {
|
|
671
|
+
return performance_5.ReadLockHandle;
|
|
672
|
+
},
|
|
673
|
+
});
|
|
674
|
+
Object.defineProperty(exports, "WriteLockHandle", {
|
|
675
|
+
enumerable: true,
|
|
676
|
+
get: function () {
|
|
677
|
+
return performance_5.WriteLockHandle;
|
|
678
|
+
},
|
|
679
|
+
});
|
|
680
|
+
Object.defineProperty(exports, "RWLock", {
|
|
681
|
+
enumerable: true,
|
|
682
|
+
get: function () {
|
|
683
|
+
return performance_5.RWLock;
|
|
684
|
+
},
|
|
685
|
+
});
|
|
686
|
+
Object.defineProperty(exports, "RWLockManager", {
|
|
687
|
+
enumerable: true,
|
|
688
|
+
get: function () {
|
|
689
|
+
return performance_5.RWLockManager;
|
|
690
|
+
},
|
|
691
|
+
});
|
|
692
|
+
Object.defineProperty(exports, "ReentrantRWLock", {
|
|
693
|
+
enumerable: true,
|
|
694
|
+
get: function () {
|
|
695
|
+
return performance_5.ReentrantRWLock;
|
|
696
|
+
},
|
|
697
|
+
});
|
|
698
|
+
var performance_6 = require("./performance");
|
|
699
|
+
Object.defineProperty(exports, "LazyQueryIterator", {
|
|
700
|
+
enumerable: true,
|
|
701
|
+
get: function () {
|
|
702
|
+
return performance_6.LazyQueryIterator;
|
|
703
|
+
},
|
|
704
|
+
});
|
|
705
|
+
Object.defineProperty(exports, "LazyQueryBuilder", {
|
|
706
|
+
enumerable: true,
|
|
707
|
+
get: function () {
|
|
708
|
+
return performance_6.LazyQueryBuilder;
|
|
709
|
+
},
|
|
710
|
+
});
|
|
711
|
+
Object.defineProperty(exports, "lazy", {
|
|
712
|
+
enumerable: true,
|
|
713
|
+
get: function () {
|
|
714
|
+
return performance_6.lazy;
|
|
715
|
+
},
|
|
716
|
+
});
|
|
717
|
+
Object.defineProperty(exports, "lazyIterator", {
|
|
718
|
+
enumerable: true,
|
|
719
|
+
get: function () {
|
|
720
|
+
return performance_6.lazyIterator;
|
|
721
|
+
},
|
|
722
|
+
});
|
|
723
|
+
Object.defineProperty(exports, "GeneratorUtils", {
|
|
724
|
+
enumerable: true,
|
|
725
|
+
get: function () {
|
|
726
|
+
return performance_6.GeneratorUtils;
|
|
727
|
+
},
|
|
728
|
+
});
|
|
729
|
+
//# sourceMappingURL=index.js.map
|