MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / insertArtifact

Function insertArtifact

packages/core/sdk/src/artifact-table.test.ts:28–53  ·  view source on GitHub ↗
(
  db: SqliteTestFumaDb,
  row: {
    readonly rowId: string;
    readonly tenant: string;
    readonly subject: string;
    readonly id: string;
    readonly title?: string;
  },
)

Source from the content-addressed store, hash-verified

26 );
27
28const insertArtifact = (
29 db: SqliteTestFumaDb,
30 row: {
31 readonly rowId: string;
32 readonly tenant: string;
33 readonly subject: string;
34 readonly id: string;
35 readonly title?: string;
36 },
37): Promise<unknown> =>
38 db.client.execute({
39 sql: `INSERT INTO artifact (row_id, tenant, owner, subject, id, title, description, code, created_at, updated_at)
40 VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
41 args: [
42 row.rowId,
43 row.tenant,
44 "user",
45 row.subject,
46 row.id,
47 row.title ?? "Dashboard",
48 null,
49 "export default function App() { return null; }",
50 Date.now(),
51 Date.now(),
52 ],
53 });
54
55describe("artifact table", () => {
56 it.effect("is created by the runtime schema bring-up", () =>

Callers 1

Calls 1

executeMethod · 0.65

Tested by

no test coverage detected