-
Notifications
You must be signed in to change notification settings - Fork 40
feat(examples): add sqlite example #1176
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: 08-14-feat_examples_add_drizzle_example
Are you sure you want to change the base?
feat(examples): add sqlite example #1176
Conversation
Claude finished @jog1t's task —— View job SQLite Example ReviewI've completed a comprehensive review of the SQLite example PR. Here's my feedback: Todo List:
Issues Found🚨 Critical Issues
|
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. |
More templates
@rivetkit/actor
@rivetkit/core
@rivetkit/db
rivetkit
@rivetkit/cloudflare-workers
@rivetkit/redis
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
commit: |
d242475
to
1d5a5d8
Compare
Claude finished @jog1t's task —— View job SQLite Example PR ReviewTodo List:
Issues Found🚨 Critical Issues
|
Aspect | SQLite (Raw SQL) | Drizzle (ORM) |
---|---|---|
Dependencies | Fewer (no ORM deps) | More (Drizzle deps) |
Learning curve | Requires SQL knowledge | Type-safe ORM approach |
Performance | Direct SQL execution | ORM overhead |
Type safety | Manual typing | Generated types |
Schema management | Manual migration | Automated migrations |
This example provides a good contrast showing developers how to use raw SQL with RivetKit.
Final Assessment
This is a solid example that demonstrates raw SQLite integration. The main improvement would be adding basic tests and potentially a performance index. The review comment about table name mismatch is incorrect - there's no mismatch in this raw SQL approach.
Recommendation: APPROVE with suggested improvements for tests and performance optimization.
bc35a94
to
1ad7f70
Compare
1d5a5d8
to
2d4ef89
Compare
Claude finished @jog1t's task —— View job Claude finished reviewing the SQLite example PR SQLite Example Code ReviewTodo List:
🔍 Review SummaryThis SQLite example provides a clean, straightforward demonstration of raw SQLite integration with RivetKit. The implementation is secure and follows most project conventions, with a few minor issues to address. 📋 Issues Found
|
Aspect | SQLite (Raw SQL) | Drizzle (ORM) |
---|---|---|
Dependencies | Minimal | More (Drizzle deps) |
Learning curve | Requires SQL knowledge | Type-safe ORM |
Dev script | tsx --watch |
tsx --loader @rivetkit/sql-loader --watch |
Database setup | Manual migration | Schema + migrations |
Type safety | Manual typing | Generated types |
📝 Recommendations
- Add basic tests: Include test file similar to
examples/counter/tests/counter.test.ts
- Consider performance: Add timestamp index if expecting high message volume
- Optional: Add comment explaining this demonstrates raw SQL vs Drizzle approach
🏁 Final Assessment
APPROVED ✅ - This is a solid example that effectively demonstrates raw SQLite integration with RivetKit. The main improvement would be adding basic tests. The review comment about table name mismatch is incorrect and can be ignored.
The example provides valuable contrast to the Drizzle example and follows RivetKit conventions well.
Claude finished @jog1t's task —— View job SQLite Example PR ReviewTodo List:
Overall AssessmentThis SQLite example provides a clean demonstration of raw SQL integration with RivetKit. The implementation is secure, follows most project conventions, and offers a good contrast to the Drizzle ORM example. Issues Found🔍 Minor Issues
✅ What's Working WellSecurity - Excellent (
Code Quality - Good
Performance - Adequate
Architecture - Clean
Comparison with Drizzle Example
Review Comment ResponseThe review comment about table name mismatch is incorrect. The SQLite example uses raw SQL without Drizzle schema, so:
Recommendations
Final Verdict✅ APPROVE - This is a solid example that demonstrates raw SQLite integration effectively. The security is excellent, the code follows project conventions, and it provides valuable contrast to the Drizzle example. The minor README inconsistencies are easily fixable. Priority: Fix README commands for consistency, consider adding tests for completeness. |
getHistory: (c) => | ||
c.db | ||
.prepare(`SELECT * FROM messages ORDER BY timestamp DESC LIMIT 100`) | ||
.all(), |
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.
Potential data exposure issue: The getHistory action returns all columns from the messages table without any filtering or sanitization. If the database schema is later extended to include sensitive fields (like IP addresses, user IDs, or other metadata), this query would expose all that data to any client that calls this action. The query should explicitly specify which columns to return rather than using SELECT *.
getHistory: (c) => | |
c.db | |
.prepare(`SELECT * FROM messages ORDER BY timestamp DESC LIMIT 100`) | |
.all(), | |
getHistory: (c) => | |
c.db | |
.prepare(`SELECT id, text, username, timestamp FROM messages ORDER BY timestamp DESC LIMIT 100`) | |
.all(), |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
Closes FRONT-764
TL;DR
Added a new SQLite integration example for RivetKit.
What changed?
Created a new example project demonstrating SQLite integration with RivetKit. The example includes:
The example shows how to:
How to test?
Why make this change?
This example provides developers with a practical demonstration of how to integrate SQLite with RivetKit for persistent data storage. It serves as a reference implementation for projects that need simple, file-based database functionality without requiring external database services.