Skip to content

Commit 4f4bf39

Browse files
committed
refactor: standardize repository method calls for improved consistency
- Updated method calls in the repository to use `find`, `insert`, `update`, and `delete` without generic type parameters for clarity. - Enhanced code readability by aligning method signatures with recent refactoring efforts.
1 parent 8fbb9db commit 4f4bf39

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

readme.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const executor = new PostgresAdapter(pool);
8080
const userRepo = new Repository<User>("users", executor);
8181

8282
// Find many
83-
const users = await userRepo.findRows<User>({
83+
const users = await userRepo.find({
8484
where: and(gt("age", 25), like("name", "%Doe%")),
8585
});
8686

@@ -106,25 +106,25 @@ console.log(result.meta);
106106
*/
107107

108108
// Find one
109-
const user = await userRepo.findRow<User>(like("email", "%@example.com"));
109+
const user = await userRepo.find(like("email", "%@example.com"));
110110

111111
// Count
112-
const count = await userRepo.count<User>(gt("age", 30));
112+
const count = await userRepo.count(gt("age", 30));
113113

114114
// Insert
115-
const newUser = await userRepo.insertOne<User>({
115+
const newUser = await userRepo.insert({
116116
name: "Rayhan",
117117
118118
});
119119

120120
// Update
121-
const updated = await userRepo.update<User>(
121+
const updated = await userRepo.update(
122122
{ name: "Ray" },
123123
like("email", "%ray%"),
124124
);
125125

126126
// Delete
127-
const deleted = await userRepo.delete<User>(like("name", "Ray%"));
127+
const deleted = await userRepo.delete(like("name", "Ray%"));
128128
```
129129

130130
### 🔍 Supported Operators

0 commit comments

Comments
 (0)