Skip to content

Commit f987859

Browse files
author
vsilent
committed
diesel replaced with r2d2 and rusqlite
1 parent dceae83 commit f987859

4 files changed

Lines changed: 8 additions & 15 deletions

File tree

DEVELOPMENT.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
| **eBPF** | aya-rs | Pure Rust eBPF framework |
4848
| **Firewall** | nftables (netlink) | Modern, faster than iptables |
4949
| **Web Framework** | Actix-web | High performance, existing codebase |
50-
| **Database** | SQLite + Diesel | Embedded, low overhead |
50+
| **Database** | SQLite + rusqlite + r2d2 | Embedded, low overhead |
5151
| **Frontend** | React + TypeScript | Existing codebase, rich ecosystem |
5252

5353
---
@@ -463,8 +463,8 @@ actix-rt = "2"
463463
actix-cors = "0.6"
464464

465465
# Database
466-
diesel = { version = "2", features = ["sqlite", "r2d2", "chrono"] }
467-
diesel_migrations = "2"
466+
rusqlite = { version = "0.32", features = ["bundled"] }
467+
r2d2 = "0.8"
468468

469469
# eBPF
470470
aya = "0.12"

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,8 @@ copies of the Software...
543543
- [aya-rs](https://aya-rs.dev/) - Rust eBPF framework
544544
- [Candle](https://github.com/huggingface/candle) - HuggingFace ML framework
545545
- [Actix-web](https://actix.rs/) - Rust web framework
546-
- [Diesel](http://diesel.rs/) - Rust ORM
546+
- [rusqlite](https://github.com/rusqlite/rusqlite) - SQLite bindings for Rust
547+
- [r2d2](https://github.com/sfackler/r2d2) - Connection pool
547548

548549
---
549550

TESTING.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ mkdir -p db
3131
# Set database URL
3232
export DATABASE_URL=./db/stackdog.db
3333

34-
# Run migrations
35-
diesel migration run
36-
37-
# Run tests
34+
# Run tests (schema is initialized automatically via init_database)
3835
cargo test --lib
3936
```
4037

@@ -135,8 +132,6 @@ touch db/stackdog.db
135132
# Set environment variable
136133
export DATABASE_URL=./db/stackdog.db
137134

138-
# Run migrations
139-
diesel migration run
140135
```
141136

142137
### eBPF Tests
@@ -183,10 +178,7 @@ RUST_BACKTRACE=full
183178
## Troubleshooting
184179

185180
### "database table not found"
186-
```bash
187-
# Run migrations
188-
diesel migration run
189-
```
181+
Tables are created automatically by `init_database` on startup. Ensure `DATABASE_URL` points to a writable path.
190182

191183
### "permission denied"
192184
```bash

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@
306306
## Technical Debt
307307

308308
- [ ] **DEBT-001**: Remove legacy container management code (v1.0.0)
309-
- [ ] **DEBT-002**: Update Diesel to v2 (breaking changes)
309+
- [x] **DEBT-002**: Replaced Diesel with rusqlite + r2d2
310310
- [ ] **DEBT-003**: Migrate from actix-web 3.x to 4.x
311311
- [ ] **DEBT-004**: Improve error handling with `thiserror`
312312
- [ ] **DEBT-005**: Add comprehensive documentation comments

0 commit comments

Comments
 (0)