[TSM.ID].[11031972] PXE : Platform X Ecosystem I [118 Module -LIVE-]
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { db } from './drizzle/db';
|
||||
import { users, tenants, saasPackages } from './drizzle/schema';
|
||||
import { eq } from 'drizzle-orm';
|
||||
|
||||
async function test() {
|
||||
try {
|
||||
console.log("Connecting...");
|
||||
const userResult = await db.select({
|
||||
id: users.id,
|
||||
email: users.email,
|
||||
tenantName: tenants.name,
|
||||
tenantLicenses: tenants.licenses,
|
||||
mediaEngineStrategy: tenants.mediaEngineStrategy,
|
||||
chatEngineStrategy: tenants.chatEngineStrategy,
|
||||
userLicenses: users.licenses,
|
||||
packageFeatures: saasPackages.features
|
||||
})
|
||||
.from(users)
|
||||
.innerJoin(tenants, eq(users.tenantId, tenants.id))
|
||||
.leftJoin(saasPackages, eq(tenants.packageId, saasPackages.id))
|
||||
.limit(1);
|
||||
console.log("Success:", userResult);
|
||||
} catch (e) {
|
||||
console.log("ERROR:", e);
|
||||
}
|
||||
process.exit(0);
|
||||
}
|
||||
test();
|
||||
Reference in New Issue
Block a user