diff --git a/convex/_generated/api.d.ts b/convex/_generated/api.d.ts index 3beca87..49207d5 100644 --- a/convex/_generated/api.d.ts +++ b/convex/_generated/api.d.ts @@ -9,6 +9,7 @@ */ import type * as abcv from "../abcv.js"; +import type * as xiong from "../xiong.js"; import type { ApiFromModules, @@ -18,6 +19,7 @@ import type { declare const fullApi: ApiFromModules<{ abcv: typeof abcv; + xiong: typeof xiong; }>; /** diff --git a/convex/abcv.ts b/convex/abcv.ts index 29b1ffc..d635bea 100644 --- a/convex/abcv.ts +++ b/convex/abcv.ts @@ -1,7 +1,6 @@ import { query, mutation, action } from "./_generated/server"; import { Kevisual } from '@kevisual/ai/browser' import { v } from "convex/values"; -import { } from "convex/server"; export const get = query({ args: {}, handler: async (ctx) => { diff --git a/convex/schema.ts b/convex/schema.ts index 9d5b547..4e173e0 100644 --- a/convex/schema.ts +++ b/convex/schema.ts @@ -5,5 +5,8 @@ import { v } from "convex/values"; export default defineSchema({ abcv: defineTable({ title: v.string(), - }) + }), + xiong: defineTable({ + name: v.string(), + }), }); \ No newline at end of file diff --git a/convex/xiong.ts b/convex/xiong.ts new file mode 100644 index 0000000..fb1fe91 --- /dev/null +++ b/convex/xiong.ts @@ -0,0 +1,8 @@ +import { query, mutation, action } from "./_generated/server"; + +export const get = query({ + args: {}, + handler: async (ctx) => { + return await ctx.db.query("xiong").collect(); + }, +}); \ No newline at end of file diff --git a/index.ts b/index.ts index 3ed86c5..5a3e865 100644 --- a/index.ts +++ b/index.ts @@ -21,8 +21,10 @@ const unsubscribe = client.onUpdate(api.abcv.get, {}, async (tasks) => { // const a = list[i]; // console.log(`Item ${i}:`, a.title); // } -const list = await client.action(api.abcv.chat, { message: "Hello, 1+1=?" }); -console.log("Chat response:", list); +// const list = await client.action(api.abcv.chat, { message: "Hello, 1+1=?" }); +// console.log("Chat response:", list); +const xiongList = await client.query(api.xiong.get, {}); +console.log("Xiong list:", xiongList); await Bun.sleep(1000); unsubscribe(); await client.close(); \ No newline at end of file