Skip to content

Commit

Permalink
docs: update README to include database connection cleanup instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
chessurisme committed Jan 31, 2025
1 parent ccb1e4d commit 8bbf9d1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ await db.delete('Users', 1);
console.log('Record deleted');
```

### Cleaning Up

When you're done with database operations, it's good practice to close the connection:

```javascript
db.close();
```

## API Reference 📘

### Constructor
Expand Down Expand Up @@ -148,6 +156,14 @@ Deletes a specific record by its ID from the specified object store.

**Returns**: `Promise<undefined>`

---

#### `close()`

Closes the active database connection. This is useful for cleanup when the database connection is no longer needed.

**Returns**: `void`

## Error Handling ⚠️

All methods reject with an appropriate error if an operation fails. Use `try-catch` blocks or `.catch` handlers to manage errors gracefully:
Expand Down

0 comments on commit 8bbf9d1

Please sign in to comment.