We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
db.select()
drizzle-orm
^0.30.10
drizzle-kit
^0.21.4
let query = db .select() .from(postsTable) .leftJoin(... const whereConditions = []; if (input?.genreName) { whereConditions.push(eq(genresTable.name, input.genreName)); } if (input?.keyword) { whereConditions.push(eq(keywordsTable.name, input.keyword)); } if (whereConditions.length > 0) { query = query.where(or(...whereConditions)); // error }
if you need to conditionally include certain where filters, its not easy to build a select query
Property 'where' is missing in type 'Omit<import("/node_modules/drizzle-orm/sqlite-core/query-builders/select").SQLiteSelectBase<"movies", "async", import("/node_modules/@libsql/core/lib-esm/api").ResultSet, Record<"movies", { id: import("/node_modules/drizzle-orm/sqlit...' but required in type 'Omit<import("/node_modules/drizzle-orm/sqlite-core/query-builders/select").SQLiteSelectBase<"movies", "async", import("/node_modules/@libsql/core/lib-esm/api").ResultSet, Record<"movies", { id: import("/node_modules/drizzle-orm/sqlit...'.ts(2741) select.d.ts(379, 5): 'orderBy' is declared here. let query: Omit<SQLiteSelectBase<"posts", "async", ResultSet, Record<"posts", { id: SQLiteColumn<{ name: "id"; tableName: "posts"; dataType: "number"; columnType: "SQLiteInteger"; data: number; driverParam: number; notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; }, object>; ... 20 more ...; ...
Also, it would be beneficial if combining filters accepts a list structure
.where( or( [eq(...),..] ))
It should not produce an error when building a select query. Or support nested filters in findMany
node
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What version of
drizzle-orm
are you using?^0.30.10
What version of
drizzle-kit
are you using?^0.21.4
Describe the Bug
if you need to conditionally include certain where filters, its not easy to build a select query
Also, it would be beneficial if combining filters accepts a list structure
Expected behavior
It should not produce an error when building a select query. Or support nested filters in findMany
Environment & setup
node
The text was updated successfully, but these errors were encountered: