© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
1 reply
John

Nested SQL select returning [x: string]: unknown type

This may also be delving into SQL-specific questions, but I have a complex query where I'm joining ten tables and at points, the select object is nested three deep. (I'm fairly intermediate to SQL so if I'm thinking about this wrong, please tell me).

I can get the query pretty close using the query builder syntax but I have to do some specific where/orderby selects that throw errors for some reason. No problem, I rewrite it in the db.select() syntax and it is now correctly returning data. However, the return type is just:

{
[x: string]: unknown;
}[]

Which is obviously useless for trying to use that data in my application. Not sure what I'm doing wrong here, so any help is appreciated!
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

nested select type issue
Drizzle TeamDTDrizzle Team / help
14mo ago
select with sql<number> returns string
Drizzle TeamDTDrizzle Team / help
8mo ago
Not type-safe [x:string]: any
Drizzle TeamDTDrizzle Team / help
2y ago
Json column type returning as plain string?
Drizzle TeamDTDrizzle Team / help
16mo ago