feat(BUG): Azure CosmosDB Integration

This commit is contained in:
2025-06-03 02:41:26 +09:00
parent f6d77c8c9b
commit 3256dc4395
5 changed files with 2579 additions and 368 deletions

22
server/node/db.spec.js Normal file
View File

@@ -0,0 +1,22 @@
const { CosmosStore } = require("./db.cjs");
describe("Azure Cosmos DB", () => {
test("should able to create", async () => {
const c = new CosmosStore(
"http://127.0.0.1:8081",
"C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==",
"db",
"container",
);
const data = Buffer.from("sfsdf");
await c.createData("hello2", data);
const l = await c.listData();
expect(l.length).toBeGreaterThanOrEqual(1);
const d = await c.getData("hello2");
console.log(d);
expect(d).toBe(data);
});
});