Skip to content

Commit

Permalink
feature: remove document snapshots (#46)
Browse files Browse the repository at this point in the history
The query to materialize documents at a particular commit is at most two
selects with low cardinality which is honestly pan comido for the
database there is no point in having the snapshots table specially
considering we are not a proxy anymore.
  • Loading branch information
geclos authored Jul 19, 2024
1 parent 70a37d7 commit 6d93bf1
Show file tree
Hide file tree
Showing 14 changed files with 677 additions and 104 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { materializeDocumentsAtCommit } from '@latitude-data/core'
import { getDocumentsAtCommit } from '@latitude-data/core'
import { NextRequest, NextResponse } from 'next/server'

export async function GET(
Expand All @@ -8,7 +8,7 @@ export async function GET(
}: { params: { commitUuid: string; projectId: number } },
) {
try {
const documents = await materializeDocumentsAtCommit({
const documents = await getDocumentsAtCommit({
commitUuid,
projectId: Number(projectId),
})
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/Sidebar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { materializeDocumentsAtCommit } from '@latitude-data/core'
import { getDocumentsAtCommit } from '@latitude-data/core'

import DocumentTree, { CreateNode } from './DocumentTree'

Expand All @@ -9,7 +9,7 @@ export default async function Sidebar({
commitUuid: string
projectId: number
}) {
const documentsResult = await materializeDocumentsAtCommit({
const documentsResult = await getDocumentsAtCommit({
projectId,
commitUuid,
})
Expand Down
1 change: 1 addition & 0 deletions packages/core/drizzle/0006_strong_norman_osborn.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "latitude"."document_snapshots";
2 changes: 1 addition & 1 deletion packages/core/drizzle/meta/0005_snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -753,4 +753,4 @@
"schemas": {},
"tables": {}
}
}
}
Loading

0 comments on commit 6d93bf1

Please sign in to comment.