-
Notifications
You must be signed in to change notification settings - Fork 40
feat(examples): add drizzle example #1175
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
base: graphite-base/1175
Are you sure you want to change the base?
Conversation
Claude finished @jog1t's task —— View job Reviewing Drizzle Example PRI've completed my review of the Drizzle example implementation. Here's my comprehensive feedback: Todo List:
Review Feedback✅ Positive Aspects
🔧 Issues FoundCritical Issues
Best Practice Issues
Code Quality Issues
🔒 Security Considerations
⚡ Performance Considerations
🧪 Test Coverage
📝 Suggested Improvements
🎯 Overall AssessmentThis is a solid foundation for a Drizzle integration example, but needs refinement to meet RivetKit's standards. The core functionality is correct, but error handling, validation, and documentation need improvement. Priority Fixes:
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
eb378c1
to
bc35a94
Compare
Claude finished @jog1t's task —— View job Reviewing Drizzle Example PRI've completed my review of the Drizzle example implementation. Here's my comprehensive feedback: Todo List:
Review Feedback✅ Positive Aspects
🔧 Issues FoundCode Quality Issues
Security Considerations
Performance Considerations
🧪 Test Coverage
🔒 Security Assessment
📝 Suggested Improvements
🎯 Overall AssessmentThis is a solid foundation for a Drizzle integration example that demonstrates the core functionality well. The implementation correctly shows how to:
Priority Fixes:
The example successfully demonstrates Drizzle integration and would be valuable for developers, but could be more robust with the suggested improvements. |
More templates
@rivetkit/actor
@rivetkit/core
@rivetkit/db
rivetkit
@rivetkit/cloudflare-workers
@rivetkit/redis
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
commit: |
0ac4009
to
8d154f5
Compare
bc35a94
to
1ad7f70
Compare
Claude finished @jog1t's task —— View job Reviewing Drizzle Example PRTodo List:
Review Feedback✅ Positive Aspects
🔧 Issues FoundCritical Issues
Code Quality Issues
Security Considerations
Performance Considerations
🧪 Test Coverage
📝 Suggested Improvements1. Fix README Installation Instructions# examples/drizzle/README.md:20
- pnpm install
+ npm install 2. Add Input Validationimport { z } from "zod";
const messageSchema = z.object({
sender: z.string().min(1).max(50),
text: z.string().min(1).max(1000)
});
sendMessage: async (c, sender: string, text: string) => {
const validated = messageSchema.parse({ sender, text });
// ... rest of implementation
} 3. Add Error Handlingimport { InternalError } from "@rivetkit/actor/errors";
import { logger } from "@rivetkit/actor";
sendMessage: async (c, sender: string, text: string) => {
try {
// validation and insertion
} catch (error) {
logger().error("failed to send message", { error });
throw new InternalError("Failed to send message");
}
} 4. Add JSDoc Documentation/**
* Send a new message to the chat
* @param sender - The sender's identifier
* @param text - The message content
* @returns The created message with timestamp
*/
sendMessage: async (c, sender: string, text: string) => {
// implementation
}
/**
* Get chat message history
* @returns Array of recent messages, ordered by timestamp (newest first)
*/
getHistory: (c) => {
// implementation
} 5. Add Database Index// src/db/schema.ts
export const messagesTable = sqliteTable("messages_table", {
id: int().primaryKey({ autoIncrement: true }),
sender: text().notNull(),
text: text().notNull(),
timestamp: int().notNull(),
}, (table) => ({
timestampIdx: index("timestamp_idx").on(table.timestamp)
})); 6. Add Constantsconst MESSAGE_HISTORY_LIMIT = 100;
getHistory: (c) =>
c.db
.select()
.from(schema.messagesTable)
.orderBy(desc(schema.messagesTable.timestamp))
.limit(MESSAGE_HISTORY_LIMIT), 🎯 Overall AssessmentThis is a solid foundation for a Drizzle integration example that successfully demonstrates:
The core functionality is correct and provides a good learning resource for developers. However, the example needs refinement to meet RivetKit's coding standards, particularly around input validation, error handling, and documentation. Priority Fixes:
Secondary Improvements: The example successfully demonstrates Drizzle integration and would be valuable for developers looking to build real-time applications with persistent storage using RivetKit. |
Claude finished @jog1t's task —— View job Reviewing Drizzle Example PRTodo List:
Review Feedback✅ Positive Aspects
🔧 Issues FoundCritical Issues
Code Quality Issues
Security Considerations
Performance Considerations
🧪 Test Coverage
📝 Suggested Improvements
🎯 Overall AssessmentThis is a solid foundation for a Drizzle integration example that demonstrates the core functionality well. The implementation correctly shows how to:
Priority Fixes:
The example successfully demonstrates Drizzle integration and would be valuable for developers, but needs these improvements to meet RivetKit's quality standards and provide a more robust reference implementation. |
Closes FRONT-764
TL;DR
Updated the Drizzle example to implement a functional chat application with message storage and retrieval.
What changed?
sendMessage
andgetHistory
actionsHow to test?
cd rivetkit/examples/drizzle
pnpm install
pnpm run dev
Why make this change?
This change provides a complete, working example of Drizzle ORM integration with RivetKit, demonstrating how to:
The example now serves as a practical reference for developers looking to build real-time applications with persistent storage using RivetKit and Drizzle.