Created
April 2, 2025 19:57
-
-
Save jmikedupont2/3911dce8ed24d989151a71971f122b5f to your computer and use it in GitHub Desktop.
eliza query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PGlite } from "@electric-sql/pglite"; | |
const db = new PGlite("file:///var/run/agent/database/"); | |
//let res = await db.query("select table_schema, count(*) from information_schema.tables group by table_schema;"); | |
//let res = await db.query("select table_name,table_schema from information_schema.tables where table_schema = 'public';"); | |
let res = await db.query("select * from public.worlds;"); | |
//console.log(res) | |
res.rows.forEach((row) => { | |
console.log("World",row); | |
}); | |
let res2 = await db.query("select * from public.agents;"); | |
//console.log(res2) | |
res2.rows.forEach((row) => { | |
console.log("Agent", row); | |
}); | |
let res3 = await db.query("select * from public.rooms;"); | |
//console.log(res3) | |
res3.rows.forEach((row) => { | |
console.log("Room", row); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment