-
Notifications
You must be signed in to change notification settings - Fork 1
chore(database): Use Drizzle ORM #145
New issue
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
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements Drizzle ORM to replace the existing database implementation, transitioning from raw PostgreSQL queries to a type-safe ORM solution. The changes include restructuring database schema definitions, updating all database operations to use Drizzle, and migrating configuration management for database connections.
- Complete database layer rewrite from raw PostgreSQL to Drizzle ORM
- Restructured database schema with proper TypeScript type inference
- Updated all database operations and queries throughout the application
Reviewed Changes
Copilot reviewed 32 out of 37 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/db/schema.ts | New Drizzle schema definitions replacing raw SQL table creation |
| src/db/youtube.ts | Rewritten YouTube database operations using Drizzle ORM |
| src/db/twitch.ts | Rewritten Twitch database operations using Drizzle ORM |
| src/db/discord.ts | Rewritten Discord database operations using Drizzle ORM |
| src/utils/youtube/fetchLatestUploads.ts | Updated to use new Drizzle-based database functions |
| src/utils/twitch/checkIfStreamerIsLive.ts | Updated to use new Drizzle-based database functions |
| src/config.ts | Simplified database configuration to use connection URLs |
| package.json | Added Drizzle ORM dependencies and migration scripts |
Comments suppressed due to low confidence (1)
src/utils/youtube/fetchLatestUploads.ts:147
- [nitpick] The variable name
updateSuccessis not descriptive enough. Consider renaming it toupdateResultorvideoUpdateResultto better reflect that it contains both success status and potentially other data.
const updateSuccess = await youtubeUpdateVideoId(
To make managing the database easier, we're going to implement Drizzle ORM.
reason for changes and list etc. will be soon