Monk
Monk
CCConvex Community
Created by Monk on 5/7/2024 in #support-community
"convex dev --until-success" dev:init exited with 1
Hello, I am travelling and on a new laptop and forgot to get my project loaded up and working before I left. I have cloned my project, filled in my env.local, run npm install and installed convex globally.
When I run the dev command: npm-run-all dev:init --parallel dev:server dev:client I will spin on preparing convex functions for only a moment before I receive ERROR: "dev:init" exited with 1. What might I be missing? is there a verbose option for this init? I also tried running the existing project command, but it just seemed to place the values I already had in my env.local.
18 replies
CCConvex Community
Created by Monk on 4/4/2024 in #support-community
inArray or sql in options?
Hello, looking for some guidance on doing a sql in with convex. In drizzle, I am doing something like:
const dbMatchups: Matchup[] = await db.query.matchups.findMany({
where: and(eq(matchups.league, league), inArray(matchups.game_id, gameIds)),
})
const dbMatchups: Matchup[] = await db.query.matchups.findMany({
where: and(eq(matchups.league, league), inArray(matchups.game_id, gameIds)),
})
I'm not seeing a good way to do similar in convex, other than previous suggestions to query all and filter in ts. Is there a way to do something like:

export const getMatchupsByGameIds = query({
args: { gameIds: v.array(v.string()) },
handler: async (ctx, { gameIds }) => {
const matchups = await ctx.db
.query("matchups")
.withIndex("by_active_game_ids", (q) => q.in("game_id", gameIds))
.take(500);
return matchups;
},
});

export const getMatchupsByGameIds = query({
args: { gameIds: v.array(v.string()) },
handler: async (ctx, { gameIds }) => {
const matchups = await ctx.db
.query("matchups")
.withIndex("by_active_game_ids", (q) => q.in("game_id", gameIds))
.take(500);
return matchups;
},
});
thanks!
2 replies