@jazim/test 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -33
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,6 +41,15 @@ This package requires the following peer dependencies:
|
|
|
41
41
|
npm install better-auth typeorm
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
## Better Auth CLI Generate Schema
|
|
45
|
+
You can use the Better Auth CLI to generate the database schema using the TypeORM adapter.
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx @better-auth/cli@latest generate
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
For more information, refer to the [Better Auth CLI documentation](https://www.better-auth.com/docs/concepts/cli).
|
|
52
|
+
|
|
44
53
|
## Quick Start
|
|
45
54
|
|
|
46
55
|
### 1. Setup TypeORM DataSource
|
|
@@ -352,39 +361,6 @@ export class BetterAuthMigration1234567890 implements MigrationInterface {
|
|
|
352
361
|
}
|
|
353
362
|
```
|
|
354
363
|
|
|
355
|
-
## Advanced Features
|
|
356
|
-
|
|
357
|
-
### Query Operators
|
|
358
|
-
|
|
359
|
-
The adapter supports various query operators:
|
|
360
|
-
|
|
361
|
-
- `eq` - Equal
|
|
362
|
-
- `ne` - Not equal
|
|
363
|
-
- `lt` - Less than
|
|
364
|
-
- `lte` - Less than or equal
|
|
365
|
-
- `gt` - Greater than
|
|
366
|
-
- `gte` - Greater than or equal
|
|
367
|
-
- `in` - In array
|
|
368
|
-
- `not_in` - Not in array
|
|
369
|
-
- `contains` - String contains
|
|
370
|
-
- `starts_with` - String starts with
|
|
371
|
-
- `ends_with` - String ends with
|
|
372
|
-
|
|
373
|
-
### Error Handling
|
|
374
|
-
|
|
375
|
-
The adapter provides detailed error messages wrapped in `BetterAuthError` for easier debugging:
|
|
376
|
-
|
|
377
|
-
```typescript
|
|
378
|
-
try {
|
|
379
|
-
await auth.api.signInEmail({
|
|
380
|
-
email: "user@example.com",
|
|
381
|
-
password: "password",
|
|
382
|
-
});
|
|
383
|
-
} catch (error) {
|
|
384
|
-
console.error(error.message); // Detailed error from the adapter
|
|
385
|
-
}
|
|
386
|
-
```
|
|
387
|
-
|
|
388
364
|
## Database Schema
|
|
389
365
|
|
|
390
366
|
The adapter creates the following tables (default names):
|