A lightweight and simple in-memory database built with Go and Gin for learning purposes. Supports CRUD operations with concurrent access handling using sync.RWMutex.
✅ Insert and Update operations
✅ Retrieve records by ID
✅ JSON-based storage format
✅ Integrated with Gin for API access
✅ Thread-safe with RWMutex
✅ Simple file-based persistence
git clone https://github.com/yourusername/go-simple-db.git
cd go-simple-dbgo mod tidygo run main.goThe server will start at http://localhost:8080 🚀
| Method | Endpoint | Description |
|---|---|---|
POST |
/insert |
Insert a new record |
PUT |
/update/:id |
Update a record by ID |
GET |
/get/:id |
Retrieve a record |
DELETE |
/delete/:id |
Delete a record |
GET |
/all |
Get all records |
{
"id": 1,
"attributes": {
"name": "Go Database",
"language": "Go"
}
}Let me know if you want to modify anything! 🚀