Doogibo
Doogibo
CCConvex Community
Created by Doogibo on 12/13/2024 in #support-community
VERCEL_URL - dynamic Convex env
Thank you so much everyone!
26 replies
CCConvex Community
Created by Doogibo on 12/13/2024 in #support-community
VERCEL_URL - dynamic Convex env
WOOHOOOOOOOO!!!! :fixed:
26 replies
CCConvex Community
Created by Doogibo on 12/13/2024 in #support-community
VERCEL_URL - dynamic Convex env
Oooooh! Let me give that a shot. šŸ™‚
26 replies
CCConvex Community
Created by Doogibo on 12/13/2024 in #support-community
VERCEL_URL - dynamic Convex env
Let me try deploying again to see, I didn't copy it but I feel like it was the preview one not the prod one.
26 replies
CCConvex Community
Created by Doogibo on 12/13/2024 in #support-community
VERCEL_URL - dynamic Convex env
Oh you said CONVEX_URL, my bad.
26 replies
CCConvex Community
Created by Doogibo on 12/13/2024 in #support-community
VERCEL_URL - dynamic Convex env
&& echo "Deploy key exists: $CONVEX_DEPLOY_KEY" && npx convex env set VERCEL_URL $VERCEL_URL Does print out the key correctly. Interesting
26 replies
CCConvex Community
Created by Doogibo on 12/13/2024 in #support-community
VERCEL_URL - dynamic Convex env
That would be great. Still no dice on my end šŸ˜¦
26 replies
CCConvex Community
Created by Doogibo on 12/13/2024 in #support-community
VERCEL_URL - dynamic Convex env
@ballingt Well this is actually what we get: Finished running function "system/dummy:seedForPreviewDeployments" āœ– Please set CONVEX_DEPLOY_KEY to a new key which you can find on your Convex dashboard. Which we don't get unless we include the second env set command.
26 replies
CCConvex Community
Created by Doogibo on 12/13/2024 in #support-community
VERCEL_URL - dynamic Convex env
Still struggling. Really want the CLI env set approach to work:
npx convex deploy --cmd 'npm run build' --preview-run 'system/dummy:seedForPreviewDeployments' && npx convex env set VERCEL_URL $VERCEL_URL
npx convex deploy --cmd 'npm run build' --preview-run 'system/dummy:seedForPreviewDeployments' && npx convex env set VERCEL_URL $VERCEL_URL
Thinking it's possibly the "once it's provisioned" piece... don't get any helpful errors in the vercel deploy logs.
26 replies
CCConvex Community
Created by Doogibo on 12/13/2024 in #support-community
VERCEL_URL - dynamic Convex env
Ah yes another solid option!
26 replies
CCConvex Community
Created by Doogibo on 12/13/2024 in #support-community
VERCEL_URL - dynamic Convex env
OK perfect thank you Tom! I will try this. šŸ˜„
26 replies
CCConvex Community
Created by Doogibo on 12/13/2024 in #support-community
VERCEL_URL - dynamic Convex env
Yes that's right
26 replies
CCConvex Community
Created by Doogibo on 12/13/2024 in #support-community
VERCEL_URL - dynamic Convex env
Alternatively I guess we could pass it as an argument to our functions from the client, since VERCEL_URL is automatically set there. Easier... thoughts? EDIT: I really don't like this approach actually... would involve passing it down in so many cases (any endpoint that fires a notification action, etc.).
26 replies
CCConvex Community
Created by Doogibo on 11/29/2024 in #support-community
Conditionally Building Queries
Thanks Lee and everyone else. It's fine for now. Could definitely be made nicer, but moving on for now. šŸ™‚
10 replies
CCConvex Community
Created by Doogibo on 11/29/2024 in #support-community
Conditionally Building Queries
Thanks @lee , just to make sure I'm not missing anything... to remove all TS errors I had to do something like the following:
type RequestTableInfo = {
document: Doc<'requests'>;
fieldPaths: string;
indexes: {
by_caseNumber: ['caseNumber', '_creationTime'];
};
searchIndexes: {
search: {
searchField: 'searchText';
filterFields: never;
};
};
vectorIndexes: Record<string, never>;
};

const preIndexQuery = ctx.db.query('requests');
let postIndexQuery: Query<RequestTableInfo> = preIndexQuery;

if (true) {
postIndexQuery = preIndexQuery.withIndex('by_caseNumber', q =>
q.eq('caseNumber', 'blah')
);
}

if (true) {
postIndexQuery = postIndexQuery.filter(q =>
q.neq(q.field('status'), 'DRAFT')
);
}

let orderedQuery: OrderedQuery<RequestTableInfo> = postIndexQuery;

if (true) {
orderedQuery = postIndexQuery.order('desc');
}
type RequestTableInfo = {
document: Doc<'requests'>;
fieldPaths: string;
indexes: {
by_caseNumber: ['caseNumber', '_creationTime'];
};
searchIndexes: {
search: {
searchField: 'searchText';
filterFields: never;
};
};
vectorIndexes: Record<string, never>;
};

const preIndexQuery = ctx.db.query('requests');
let postIndexQuery: Query<RequestTableInfo> = preIndexQuery;

if (true) {
postIndexQuery = preIndexQuery.withIndex('by_caseNumber', q =>
q.eq('caseNumber', 'blah')
);
}

if (true) {
postIndexQuery = postIndexQuery.filter(q =>
q.neq(q.field('status'), 'DRAFT')
);
}

let orderedQuery: OrderedQuery<RequestTableInfo> = postIndexQuery;

if (true) {
orderedQuery = postIndexQuery.order('desc');
}
Have I missed a more convenient way to get this done? All good either way (when I didn't specify the search index, it complained... adding it solved it... even though I'm not using the search index in my query)!
10 replies