Gerhard
Gerhard
CDCloudflare Developers
Created by Gerhard on 3/21/2024 in #workers-help
specific placement
thx, yes.. I'm probably trying a wrong use case. The durability in understandable. It would be great it was possible to simply start a worker in a location. Since the concept of a worker is to do some work.. and often that is locally. Cloudflare workers are more designed for end user apis to some form of backend storage, and it seem they assume to choose for you is better. Maybe workers vs background workers concept needs to be tought of. However, you said it's available in enterprise. I'll need to dig.
12 replies
CDCloudflare Developers
Created by Gerhard on 3/21/2024 in #workers-help
specific placement
thx, so that nullify my whole idea. If Iam to test url uptime and response times for Aus and South Africa.. It will be meaningless, since it will come from another continent. for now I'll stick to my fly.io servers which I can pick where to deploy.
12 replies
CDCloudflare Developers
Created by Gerhard on 3/21/2024 in #workers-help
specific placement
but https://developers.cloudflare.com/durable-objects/reference/data-location/#provide-a-location-hint a afr and sam suggestion for DO locations? What's the point of suggesting afr if it's going to end up in where? Europe?
12 replies
CDCloudflare Developers
Created by Gerhard on 3/21/2024 in #workers-help
specific placement
Thx, seems like I could get away by creating the DO in the right region. It still means then firing up a small Fly.io server in the right region to initiate the request. It’s not as much governance as it is practical requirement. We have many cloud services running in various countries, and testing endpoint uptime makes only sense if the uptime check is done from the same country/region. Eg: node ping test our Australian endpoints, but it does it from Finland, which makes no sense. The Aussie apps are only used by Aussie customers, and there fore we want to test it only from that region. There are things like international latency and connectivity issues which we want to avoid.
12 replies
DTDrizzle Team
Created by gmaclennan on 8/5/2023 in #help
JS API for generating CREATE TABLE sql?
if you import your schemas, then use migrate to create the tables in the memory db.
import { someTable } from '$lib/schemas/someTable';
import { migrate } from "drizzle-orm/better-sqlite3/migrator";

async function createLocalSQLiteDB(path: string): Promise<BetterSQLite3Database> {
const sqlite = await createSQLiteDB(path);
const db: BetterSQLite3Database = drizzle(sqlite);
return db;
}

describe('db operations', async () => {

const db = await createLocalSQLiteDB(':memory:');
beforeAll(async () => {
migrate(db, { migrationsFolder: 'drizzle' });
})
import { someTable } from '$lib/schemas/someTable';
import { migrate } from "drizzle-orm/better-sqlite3/migrator";

async function createLocalSQLiteDB(path: string): Promise<BetterSQLite3Database> {
const sqlite = await createSQLiteDB(path);
const db: BetterSQLite3Database = drizzle(sqlite);
return db;
}

describe('db operations', async () => {

const db = await createLocalSQLiteDB(':memory:');
beforeAll(async () => {
migrate(db, { migrationsFolder: 'drizzle' });
})
something along those lines..
3 replies