vault-video-processor / db-check.ts
dvijaykrishnan's picture
feat: Introduce database utility scripts, refactor video product retrieval, and ensure correct creator slug usage in the showcase service.
f0f2816
Raw
History Blame Contribute Delete
933 Bytes
import { db } from './src/lib/db';
import { youtubeChannels, youtubeVideos } from './src/lib/db/schema';
import { eq, and } from 'drizzle-orm';
async function check() {
try {
const videoId = 'XSa42Zz_vps';
console.log(`Checking video: ${videoId}`);
const results = await db
.select({
id: youtubeVideos.id,
videoId: youtubeVideos.videoId,
channelId: youtubeVideos.channelId,
creatorSlug: youtubeChannels.creatorSlug,
creatorId: youtubeChannels.creatorId
})
.from(youtubeVideos)
.innerJoin(youtubeChannels, eq(youtubeVideos.channelId, youtubeChannels.id))
.where(eq(youtubeVideos.videoId, videoId));
console.log('Results:', JSON.stringify(results, null, 2));
} catch (err) {
console.error('Error:', err);
}
process.exit(0);
}
check();