mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix(large-refs): cleanup based on table read (#4716)
* fix(large-refs): cleanup based on table read * address comments * address comments * bubble up storage ref errors * cleanup code * do not attempt blob deletion for infra outage * cleanup dup helper
This commit is contained in:
@@ -234,20 +234,25 @@ export const dbChainMock = {
|
||||
* Creates a mock database connection.
|
||||
*/
|
||||
export function createMockDb() {
|
||||
const fromBuilder = () => ({
|
||||
where: vi.fn(() => ({
|
||||
limit: vi.fn(() => Promise.resolve([])),
|
||||
orderBy: vi.fn(() => Promise.resolve([])),
|
||||
})),
|
||||
leftJoin: vi.fn(() => ({
|
||||
where: vi.fn(() => Promise.resolve([])),
|
||||
})),
|
||||
innerJoin: vi.fn(() => ({
|
||||
where: vi.fn(() => Promise.resolve([])),
|
||||
})),
|
||||
})
|
||||
|
||||
return {
|
||||
select: vi.fn(() => ({
|
||||
from: vi.fn(() => ({
|
||||
where: vi.fn(() => ({
|
||||
limit: vi.fn(() => Promise.resolve([])),
|
||||
orderBy: vi.fn(() => Promise.resolve([])),
|
||||
})),
|
||||
leftJoin: vi.fn(() => ({
|
||||
where: vi.fn(() => Promise.resolve([])),
|
||||
})),
|
||||
innerJoin: vi.fn(() => ({
|
||||
where: vi.fn(() => Promise.resolve([])),
|
||||
})),
|
||||
})),
|
||||
from: vi.fn(fromBuilder),
|
||||
})),
|
||||
selectDistinct: vi.fn(() => ({
|
||||
from: vi.fn(fromBuilder),
|
||||
})),
|
||||
insert: vi.fn(() => ({
|
||||
values: vi.fn(() => ({
|
||||
|
||||
@@ -157,6 +157,29 @@ export const schemaMock = {
|
||||
files: 'files',
|
||||
createdAt: 'createdAt',
|
||||
},
|
||||
executionLargeValues: {
|
||||
key: 'key',
|
||||
workspaceId: 'workspaceId',
|
||||
workflowId: 'workflowId',
|
||||
ownerExecutionId: 'ownerExecutionId',
|
||||
size: 'size',
|
||||
createdAt: 'createdAt',
|
||||
deletedAt: 'deletedAt',
|
||||
},
|
||||
executionLargeValueReferences: {
|
||||
key: 'key',
|
||||
executionId: 'executionId',
|
||||
source: 'source',
|
||||
workspaceId: 'workspaceId',
|
||||
workflowId: 'workflowId',
|
||||
createdAt: 'createdAt',
|
||||
},
|
||||
executionLargeValueDependencies: {
|
||||
parentKey: 'parentKey',
|
||||
childKey: 'childKey',
|
||||
workspaceId: 'workspaceId',
|
||||
createdAt: 'createdAt',
|
||||
},
|
||||
pausedExecutions: {
|
||||
id: 'id',
|
||||
workflowId: 'workflowId',
|
||||
|
||||
Reference in New Issue
Block a user