sanner
Explore posts from serversCDCloudflare Developers
•Created by sanner on 9/2/2024 in #workers-help
knex+workers TypeError
I was working with Cloudflare Workers + bun & Hono and was using Knex as my orm. I was successfully ably to make a connection on Cloudlfare Pages to Knex+Postgres with Connection Pooling however on Workers I am recieving a TypeErorr.
I tried using both the connectionString and specifiying the individual parameters for the database. Additionally I set node_compat = true
and also added the prefix previously when using compatibility_flags = ["nodejs_compat"]
I also played around with the version numbers of both the sql connection adapter and javascript
[wrangler:err] TypeError: this.driver.Client is not a constructor
at Client_PG._acquireOnlyConnection (file:///home/sanner/Coding/Anemo/auth.ran.so/node_modules/knex/lib/dialects/postgres/index.js:81:24)
at Client_PG.acquireRawConnection (file:///home/sanner/Coding/Anemo/auth.ran.so/node_modules/knex/lib/dialects/postgres/index.js:99:17)
at create (file:///home/sanner/Coding/Anemo/auth.ran.so/node_modules/knex/lib/client.js:262:39)
javascript
knex({
client: 'pg', // Replace 'pg' with your database client if different
connection: {
host: "hostDB",
port: 5432,
user: "postgres",
password: "passwordDB",
database: "databaseName",
ssl: {
rejectUnauthorized: false,
},
},
searchPath: ['knex', 'public'], // Optional: Specify search path for PostgreSQL
});
```
1 replies
CDCloudflare Developers
•Created by sanner on 8/27/2024 in #pages-help
OATUH Cloudflare Pages
I was developing trying to implement github oauth on cloudfare pages using a beta branch. the production branch is define as another branch and the production branch contains the main url. It works locally but not on cloudflare pages
my oauth flow looks like this at the moment
25 replies
CDCloudflare Developers
•Created by sanner on 8/27/2024 in #general-help
Cloudflare Pages Oauth (Google/Github)
I was developing trying to implement github oauth on cloudfare pages using a beta branch. the production branch is define as another branch and the production branch contains the main url. It works locally but not on cloudflare pages
my oauth flow looks like this at the moment
3 replies