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

Function run

packages/core/fumadb/test/query/query.test.ts:31–208  ·  view source on GitHub ↗
(orm: AbstractQuery<typeof v1>)

Source from the content-addressed store, hash-verified

29 },
30 });
31async function run(orm: AbstractQuery<typeof v1>): Promise<string> {
32 const lines: string[] = [];
33
34 lines.push("create one");
35 lines.push(
36 inspect(
37 await orm.create("users", {
38 id: "generated-cuid",
39 name: "fuma",
40 }),
41 { depth: null, sorted: true },
42 ),
43 );
44 lines.push("create other users");
45 lines.push(
46 inspect(
47 await orm.createMany("users", [
48 {
49 id: "alfon",
50 name: "alfon",
51 },
52 {
53 id: "test",
54 name: "Test User",
55 },
56 ]),
57 { depth: null, sorted: true },
58 ),
59 );
60
61 lines.push("initial data ready");
62 await orm.createMany("messages", [
63 {
64 user: "alfon",
65 content: "Hello World 1 by alfon",
66 id: "1",
67 },
68 {
69 user: "alfon",
70 content: "Hello World 2 by alfon",
71 id: "2",
72 mentionId: "1",
73 },
74 ]);
75 lines.push(
76 inspect(await orm.findMany("users", { orderBy: ["id", "asc"] }), {
77 depth: null,
78 sorted: true,
79 }),
80 inspect(await orm.findMany("messages", { orderBy: ["id", "asc"] }), {
81 depth: null,
82 sorted: true,
83 }),
84 );
85
86 lines.push("test joins: user -> messages -> mentioned by");
87 lines.push(
88 inspect(

Callers 3

query.test.tsFile · 0.70
makeSafeFumaQueryFunction · 0.50
sqliteDataMigrationFunction · 0.50

Calls 5

upsertBobFunction · 0.85
getBobFunction · 0.85
pushMethod · 0.80
countMethod · 0.80
transactionMethod · 0.65

Tested by

no test coverage detected