feat(core): user data db (#7930)

This commit is contained in:
EYHN
2024-09-11 07:55:37 +00:00
parent 498a69af53
commit d93c3b3719
36 changed files with 1220 additions and 281 deletions
@@ -29,7 +29,7 @@ test('can create new db file if not exists', async () => {
'@affine/electron/helper/db/workspace-db-adapter'
);
const workspaceId = v4();
const db = await openWorkspaceDatabase(workspaceId);
const db = await openWorkspaceDatabase('workspace', workspaceId);
const dbPath = path.join(
appDataPath,
`workspaces/${workspaceId}`,
@@ -44,7 +44,7 @@ test('on destroy, check if resources have been released', async () => {
'@affine/electron/helper/db/workspace-db-adapter'
);
const workspaceId = v4();
const db = await openWorkspaceDatabase(workspaceId);
const db = await openWorkspaceDatabase('workspace', workspaceId);
const updateSub = {
complete: vi.fn(),
next: vi.fn(),