Júlio
Júlio
Explore posts from servers
CDCloudflare Developers
Created by Júlio on 6/20/2024 in #pages-help
Can`t use postgres-js in Cloudflare Pages
This is stopping me moving to cloudflare
13 replies
CDCloudflare Developers
Created by Júlio on 6/20/2024 in #pages-help
Can`t use postgres-js in Cloudflare Pages
Is there someplace that I can file an issue/ticket for this?
13 replies
CDCloudflare Developers
Created by Júlio on 6/20/2024 in #pages-help
Can`t use postgres-js in Cloudflare Pages
Issue unsolved
13 replies
CDCloudflare Developers
Created by Júlio on 6/20/2024 in #pages-help
Can`t use postgres-js in Cloudflare Pages
Is a postgres.js or cloudflare problem?
13 replies
CDCloudflare Developers
Created by Júlio on 6/20/2024 in #pages-help
Can`t use postgres-js in Cloudflare Pages
I tried everything, don't know what do anymore
13 replies
CDCloudflare Developers
Created by Júlio on 6/20/2024 in #pages-help
Can`t use postgres-js in Cloudflare Pages
I could get working with worker with node_compat = true, but the pages does not accept this config
13 replies
CDCloudflare Developers
Created by Júlio on 6/20/2024 in #pages-help
Can`t use postgres-js in Cloudflare Pages
It does not work with cloudflare workers either
13 replies
CDCloudflare Developers
Created by Júlio on 6/20/2024 in #pages-help
Can`t use postgres-js in Cloudflare Pages
13 replies
CDCloudflare Developers
Created by Júlio on 6/20/2024 in #pages-help
Can`t use postgres-js in Cloudflare Pages
Yeah, removing it works fine
13 replies
CDCloudflare Developers
Created by Júlio on 6/20/2024 in #pages-help
Can`t use postgres-js in Cloudflare Pages
The code:
import { Hono } from "hono";
import { renderer } from "./renderer";
import postgres from "postgres";

const app = new Hono();

app.use(renderer);

app.get("/", (c) => {
return c.render(<h1>Hello júlio!</h1>);
});

const sql = postgres(import.meta.env.VITE_DATABASE_URL, {
prepare: false,
});

app.get("/listings", async (c) => {
const listings = await sql`select * from listings limit 10;`;

return c.render(<pre>{JSON.stringify(listings, null, 2)}</pre>);
});

app.get("/projects/:name", (c) => {
return c.render(<h1>project {c.req.param("name")}</h1>);
});

export default app;
import { Hono } from "hono";
import { renderer } from "./renderer";
import postgres from "postgres";

const app = new Hono();

app.use(renderer);

app.get("/", (c) => {
return c.render(<h1>Hello júlio!</h1>);
});

const sql = postgres(import.meta.env.VITE_DATABASE_URL, {
prepare: false,
});

app.get("/listings", async (c) => {
const listings = await sql`select * from listings limit 10;`;

return c.render(<pre>{JSON.stringify(listings, null, 2)}</pre>);
});

app.get("/projects/:name", (c) => {
return c.render(<h1>project {c.req.param("name")}</h1>);
});

export default app;
13 replies
CDCloudflare Developers
Created by Júlio on 6/20/2024 in #pages-help
Can`t use postgres-js in Cloudflare Pages
As I understand the package: https://github.com/porsager/postgres is compatible with cloudflare pages and I wouldn't have to use nodejs compat. And even if I do it does not work
13 replies
DTDrizzle Team
Created by Júlio on 5/6/2024 in #help
How to get the type from a view with pgView?
and it should be able to infer the types from pgView directly with .$inferSelect
12 replies
DTDrizzle Team
Created by Júlio on 5/6/2024 in #help
How to get the type from a view with pgView?
I think this could be in the docs!
12 replies
DTDrizzle Team
Created by Júlio on 5/6/2024 in #help
How to get the type from a view with pgView?
Thanks a lot!
12 replies
DTDrizzle Team
Created by Júlio on 5/6/2024 in #help
How to get the type from a view with pgView?
It works
12 replies
DTDrizzle Team
Created by Júlio on 5/6/2024 in #help
How to get the type from a view with pgView?
The selectedFields is typed as PgColumn and not columnType
12 replies
DTDrizzle Team
Created by Júlio on 5/6/2024 in #help
How to get the type from a view with pgView?
The two solutions don't work
12 replies