@nestadmin/typeorm 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/README.md +53 -0
  2. package/package.json +11 -2
package/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # @nestadmin/typeorm
2
+
3
+ Official **TypeORM** adapter for [`@nestadmin/core`](https://www.npmjs.com/package/@nestadmin/core).
4
+
5
+ ## Features
6
+
7
+ - **Zero-Config DI Factory (`TypeOrmAdapter.create()`):** Automatically injects TypeORM `DataSource` from your NestJS DI container.
8
+ - **Auto-Introspection:** Reads `DataSource.entityMetadatas` including columns, enums, nullable/unique flags, auto-managed timestamps, and `ManyToOne` / `OneToOne` owning relations.
9
+ - **Anti N+1 Queries:** Eager-joins owning relations in `findMany()` and provides `findByIds()` for custom `@AdminAction` bulk operations.
10
+ - **Relation Combobox Search:** Built-in `searchRelation()` endpoint backing async searchable selects.
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ pnpm add @nestadmin/core @nestadmin/typeorm
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import { Module } from '@nestjs/common';
22
+ import { TypeOrmModule } from '@nestjs/typeorm';
23
+ import { AdminModule } from '@nestadmin/core';
24
+ import { TypeOrmAdapter } from '@nestadmin/typeorm';
25
+
26
+ @Module({
27
+ imports: [
28
+ TypeOrmModule.forRoot({ /* ... */ }),
29
+ AdminModule.forRoot({
30
+ title: 'My Admin',
31
+ adapter: TypeOrmAdapter.create(),
32
+ autoDiscoverAll: true,
33
+ }),
34
+ ],
35
+ })
36
+ export class AppModule {}
37
+ ```
38
+
39
+ For multiple TypeORM connections, pass your custom `DataSource` token:
40
+
41
+ ```ts
42
+ AdminModule.forRoot({
43
+ adapter: TypeOrmAdapter.create(getDataSourceToken('secondary')),
44
+ });
45
+ ```
46
+
47
+ ## Documentation
48
+
49
+ https://github.com/bbal10/nest-admin
50
+
51
+ ## License
52
+
53
+ MIT
package/package.json CHANGED
@@ -1,8 +1,17 @@
1
1
  {
2
2
  "name": "@nestadmin/typeorm",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "TypeORM adapter for @nestadmin/core",
5
5
  "license": "MIT",
6
+ "homepage": "https://github.com/bbal10/nest-admin#readme",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/bbal10/nest-admin.git",
10
+ "directory": "packages/adapter-typeorm"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/bbal10/nest-admin/issues"
14
+ },
6
15
  "keywords": [
7
16
  "nestjs",
8
17
  "admin",
@@ -30,7 +39,7 @@
30
39
  "dist"
31
40
  ],
32
41
  "dependencies": {
33
- "@nestadmin/core": "0.1.0"
42
+ "@nestadmin/core": "0.1.1"
34
43
  },
35
44
  "peerDependencies": {
36
45
  "@nestjs/common": "^10.0.0 || ^11.0.0",