A command-line application for managing a library's books, customers, and borrowings, backed by a local SQLite database.
- Book Management — add, search, edit, and delete books; track availability
- Customer Management — register and manage library members
- Borrowing Management — assign books to customers and record returns
- Persistent Storage — all data stored in a local
library.dbSQLite database
- macOS (arm64) — the binary is compiled for Apple Silicon
- No additional runtime dependencies required
./library_managementThe application uses an interactive text menu. Navigate by entering the number of the option you want.
Library Management System
1. Book Management
2. Customer Management
3. Borrowing Management
4. Exit
| Option | Description |
|---|---|
| 1 | Add a new book (title, author, ISBN) |
| 2 | Get a book by ID |
| 3 | List all books |
| 4 | List all available (not borrowed) books |
| 5 | List all currently borrowed books |
| 6 | Edit a book |
| 7 | Delete a book |
Book Management
1. Add new book
2. Get book by id
3. Get all books
4. Get all available books
5. Get all borrowed books
6. Edit book
7. Delete book
8. Exit
| Option | Description |
|---|---|
| 1 | Add a new customer (name, email, phone) |
| 2 | Get a customer by ID |
| 3 | List all customers |
| 4 | Edit a customer |
| 5 | Delete a customer |
Customer Management
1. Add new customer
2. Get customer by id
3. Get all customers
4. Edit customer
5. Delete customer
6. Exit
| Option | Description |
|---|---|
| 1 | List all borrowing records |
| 2 | Assign a book to a customer |
| 3 | Return a book |
Borrowing Management
1. Get all borrowings
2. Assign book
3. Return book
4. Exit
The application uses SQLite and creates a library.db file on first run.
books
| Column | Type | Description |
|---|---|---|
| id | INTEGER | Primary key |
| title | TEXT | Book title |
| author | TEXT | Book author |
| isbn | TEXT | ISBN number |
customers
| Column | Type | Description |
|---|---|---|
| id | INTEGER | Primary key |
| name | TEXT | Customer name |
| TEXT | Email address | |
| phone | TEXT | Phone number |
borrowings
| Column | Type | Description |
|---|---|---|
| id | INTEGER | Primary key |
| book_id | INTEGER | Foreign key → books |
| customer_id | INTEGER | Foreign key → customers |
| borrow_date | TEXT | Date the book was borrowed |
| return_date | TEXT | Date returned (null if still out) |
library_management/
├── library_management # Compiled binary (arm64 macOS)
├── library.db # SQLite database (auto-created on first run)
└── README.md
- A customer cannot return a book that belongs to another customer's borrowing record.
- A book must be available (not currently borrowed) before it can be assigned.
- The database file
library.dbis created automatically in the working directory on first run.
