using createClient
with a localhost db [Windows]
#604
-
Hi there! I have started an app using the This is the content of my import { z } from "zod";
import * as edgedb from "edgedb";
import { createTRPCRouter, publicProcedure } from "~/server/api/trpc";
import { env } from "~/env.mjs";
// const client = edgedb.createHttpClient({
const client = edgedb.createClient({
dsn: "edgedb://127.0.0.1:10700/edgedb",
tlsSecurity: env.NODE_ENV == "development" ? "insecure" : "default",
// dsn: env.EDGEDB_DSN,
// port: 10700,
});
export const exampleRouter = createTRPCRouter({
hello: publicProcedure
.input(z.object({ text: z.string() })) //
.query(({ input }) => {
return {
greeting: `Hello ${input.text}`,
};
}),
data: publicProcedure
.input(z.object({ text: z.string() })) //
.query(async ({ input }) => {
const result = await client.query("select 2+2");
// console.log(input);
console.log(result);
return {
data: result,
};
}),
}); I unfortunately don't get a result, but an exception, the logs I have are:
result returns an Is there anything obvious I am missing regarding why this isn't working? some extra context of thing triedReason for using ipv4 instead of hostname:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Seems to be that the this was failing on the password, which by default is not set/required for local instances? In my case I was able to resolve this with the following: edgedb instance reset-password -I db --password |
Beta Was this translation helpful? Give feedback.
Seems to be that the this was failing on the password, which by default is not set/required for local instances?
In my case I was able to resolve this with the following: