use env.[namespace_name].put(...)ReferenceError: env is not definedenv is not a global variable - you likely have to pass it into your function as an argument. In the workers example code you have request, env, ctx as arguments for the fetch handler:WNAM, so the worker should be placed there too, but it is placed locally instead. I guess that's a beta product issue (smart placement)... but just FYI.


discord.com A @9.9.9.9 +noall +answer +shortdiggy diggy hole
•9/2/24, 6:32 PM
export default {
// The fetch handler is invoked when this worker receives a HTTP(S) request
// and should return a Response (optionally wrapped in a Promise)
async fetch(request, env, ctx) {
//...
yourFunction(env);
}
}discord.com A @9.9.9.9 +noall +answer +short162.159.138.232
162.159.128.233
162.159.137.232
162.159.135.232
162.159.136.232node:pgknex[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)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
});