joinOnAliasedSqlFromWithClause() — drizzle-orm Function Reference
Architecture documentation for the joinOnAliasedSqlFromWithClause() function in index.ts from the drizzle-orm codebase.
Entity Profile
Dependency Diagram
graph TD 5482e0b3_2c55_3750_19ed_1b1e30fc065a["joinOnAliasedSqlFromWithClause()"] 34f01008_7c45_3804_1fad_b8b59cd8a413["MyDurableObject"] 5482e0b3_2c55_3750_19ed_1b1e30fc065a -->|defined in| 34f01008_7c45_3804_1fad_b8b59cd8a413 7c7acbfe_6328_c8df_feba_552ee62a84d9["default.fetch()"] 7c7acbfe_6328_c8df_feba_552ee62a84d9 -->|calls| 5482e0b3_2c55_3750_19ed_1b1e30fc065a b19b108f_def7_3a32_99a3_c8be51ce2fbf["beforeEach()"] 5482e0b3_2c55_3750_19ed_1b1e30fc065a -->|calls| b19b108f_def7_3a32_99a3_c8be51ce2fbf style 5482e0b3_2c55_3750_19ed_1b1e30fc065a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
integration-tests/tests/sqlite/durable-objects/index.ts lines 1973–2017
async joinOnAliasedSqlFromWithClause(): Promise<void> {
try {
await this.beforeEach();
const users = this.db.$with('users').as(
this.db
.select({
id: sql<number>`id`.as('userId'),
name: sql<string>`name`.as('userName'),
city: sql<string>`city`.as('city'),
})
.from(sql`(select 1 as id, 'John' as name, 'New York' as city) as users`),
);
const cities = this.db.$with('cities').as(
this.db
.select({
id: sql<number>`id`.as('cityId'),
name: sql<string>`name`.as('cityName'),
})
.from(sql`(select 1 as id, 'Paris' as name) as cities`),
);
const result = this.db
.with(users, cities)
.select({
userId: users.id,
name: users.name,
userCity: users.city,
cityId: cities.id,
cityName: cities.name,
})
.from(users)
.leftJoin(cities, (cols) => eq(cols.cityId, cols.userId))
.all();
Expect<
Equal<{ userId: number; name: string; userCity: string; cityId: number; cityName: string }[], typeof result>
>;
expect(result).deep.equal([{ userId: 1, name: 'John', userCity: 'New York', cityId: 1, cityName: 'Paris' }]);
} catch (error: any) {
console.error(error);
throw new Error(`joinOnAliasedSqlFromWithClause error`);
}
}
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does joinOnAliasedSqlFromWithClause() do?
joinOnAliasedSqlFromWithClause() is a function in the drizzle-orm codebase, defined in integration-tests/tests/sqlite/durable-objects/index.ts.
Where is joinOnAliasedSqlFromWithClause() defined?
joinOnAliasedSqlFromWithClause() is defined in integration-tests/tests/sqlite/durable-objects/index.ts at line 1973.
What does joinOnAliasedSqlFromWithClause() call?
joinOnAliasedSqlFromWithClause() calls 1 function(s): beforeEach.
What calls joinOnAliasedSqlFromWithClause()?
joinOnAliasedSqlFromWithClause() is called by 1 function(s): default.fetch.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free