@nauth-toolkit/database-typeorm-mysql 0.2.0 → 0.2.2
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 +42 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
MySQL / MariaDB database adapter for [nauth-toolkit](https://nauth.dev).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Same entity structure and behavior as the PostgreSQL adapter — swap the driver, keep the same auth logic.
|
|
6
6
|
|
|
7
|
-
**
|
|
7
|
+
**[Documentation](https://nauth.dev)** · **[GitHub](https://github.com/noorixorg/nauth)**
|
|
8
|
+
|
|
9
|
+
> Part of [nauth-toolkit](https://www.npmjs.com/package/@nauth-toolkit/core). Requires `@nauth-toolkit/core`.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @nauth-toolkit/core @nauth-toolkit/database-typeorm-mysql
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { DataSource } from 'typeorm';
|
|
25
|
+
import { getNAuthEntities } from '@nauth-toolkit/database-typeorm-mysql';
|
|
26
|
+
|
|
27
|
+
const dataSource = new DataSource({
|
|
28
|
+
type: 'mysql',
|
|
29
|
+
url: process.env.DATABASE_URL,
|
|
30
|
+
entities: getNAuthEntities(),
|
|
31
|
+
synchronize: true, // dev only
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Also available
|
|
38
|
+
|
|
39
|
+
| Package | Purpose |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| [`@nauth-toolkit/database-typeorm-postgres`](https://www.npmjs.com/package/@nauth-toolkit/database-typeorm-postgres) | PostgreSQL — recommended for most deployments |
|
|
42
|
+
|
|
43
|
+
See the [full package list](https://www.npmjs.com/package/@nauth-toolkit/core#package-ecosystem) in the core README.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
Free to use. See [license](https://nauth.dev/docs/license).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nauth-toolkit/database-typeorm-mysql",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "MySQL storage adapter for nauth-toolkit via TypeORM",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"format:check": "prettier --check \"src/**/*.ts\""
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@nauth-toolkit/core": "^0.2.
|
|
17
|
+
"@nauth-toolkit/core": "^0.2.2",
|
|
18
18
|
"typeorm": "^0.3.20",
|
|
19
19
|
"mysql2": "^2.3.0 || ^3.0.0"
|
|
20
20
|
},
|