Gerhard
Gerhard
Explore posts from servers
CCConvex Community
Created by Gerhard on 9/13/2024 in #support-community
efficiency of: return (await ctx.db.query("messages").collect()).length;
Thx. @lee , "separate table" that's a surprising answer. To me it seems that convex will not be suitable for administration systems where tables have 40+ columns or subObjects (json) that is unique to the record being stored. (Surely you don't want a ton of 1-1 relationships?) Think of an event, a patient admission, a treatment etc. (Chats and tasks are really basic examples) So if I want to lookup/search for a name or a field in a large table, you are going to load all the data into memory first, and then let me use array mapping to filter out the columns and send it to the client. It seems there are only "select * from table" or collection.find(qry, {"no projection"}) options in convex. Could you confirm that there is no "select col1, col4, col9 from largeTable" equivalent (even on the server)? If not, do you consider it important, or does it just not matter. (pardon the persistence, but maybe it's the lessons learned since the early 90's using 4GL / SQL and recently mongo that makes me think about optimisation of data to memory.)
7 replies
CCConvex Community
Created by Gerhard on 9/13/2024 in #support-community
efficiency of: return (await ctx.db.query("messages").collect()).length;
any ideas and plans on field/column projections in a query @lee , lists often don't need all of the underlying columns
7 replies
CCConvex Community
Created by Gerhard on 9/13/2024 in #support-community
efficiency of: return (await ctx.db.query("messages").collect()).length;
I see https://github.com/get-convex/convex-backend/issues/10 mentions a undocumented feature. Count is quite integral in data management in my view.
7 replies
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