import HelixDB from "helix-ts";
async function main() {
const client = new HelixDB("http://localhost:6969");
const central = await client.query("CreateLocation", {
name: "Central Station",
});
const market = await client.query("CreateLocation", {
name: "Market Square",
});
const harbor = await client.query("CreateLocation", {
name: "Harbor",
});
await client.query("ConnectLocations", {
from_id: central.location.id,
to_id: market.location.id,
distance_km: 2,
});
await client.query("ConnectLocations", {
from_id: market.location.id,
to_id: harbor.location.id,
distance_km: 3,
});
const result = await client.query("GetShortestPath", {
from_id: central.location.id,
to_id: harbor.location.id,
});
console.log("GetShortestPath result:", result);
}
main().catch((err) => {
console.error("GetShortestPath query failed:", err);
});