Skip to content

Commit

Permalink
Change package name
Browse files Browse the repository at this point in the history
  • Loading branch information
kibae committed Jul 31, 2022
1 parent c7b6c3d commit 2e02815
Show file tree
Hide file tree
Showing 4 changed files with 229 additions and 65 deletions.
18 changes: 9 additions & 9 deletions README.ko.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# TypeORM Sharding Repository
- TypeORM을 분산 데이터베이스 환경에서 활용할 수 있게 합니다.

[![Node.js CI](https://github.com/kibae/typeorm-sharding-repo/actions/workflows/node.js.yml/badge.svg)](https://github.com/kibae/typeorm-sharding-repo/actions/workflows/node.js.yml)
[![NPM Version](https://badge.fury.io/js/typeorm-sharding-repo.svg)](https://www.npmjs.com/package/typeorm-sharding-repo)
[![License](https://img.shields.io/github/license/kibae/typeorm-sharding-repo)](https://github.com/kibae/typeorm-sharding-repo/blob/main/LICENSE)
[![Node.js CI](https://github.com/kibae/typeorm-sharding-repository/actions/workflows/node.js.yml/badge.svg)](https://github.com/kibae/typeorm-sharding-repository/actions/workflows/node.js.yml)
[![NPM Version](https://badge.fury.io/js/typeorm-sharding-repository.svg)](https://www.npmjs.com/package/typeorm-sharding-repository)
[![License](https://img.shields.io/github/license/kibae/typeorm-sharding-repository)](https://github.com/kibae/typeorm-sharding-repository/blob/main/LICENSE)

## Install
- NPM
```shell
$ npm install typeorm-sharding-repo --save
$ npm install typeorm-sharding-repository --save
```

- Yarn
```shell
$ yarn add typeorm-sharding-repo
$ yarn add typeorm-sharding-repository
```

----
Expand Down Expand Up @@ -80,7 +80,7 @@ export class User extends ShardingBaseEntity {
### 3. RepositoryService (Abstract repository for TypeORM.BaseEntity and ShardingBaseEntity)
- TypeORM.BaseEntity과 ShardingBaseEntity와 호횐되는 `RepositoryService`를 제공합니다.
- 이 패턴을 활용할 경우 sharding 적용 여부를 변경하더라도 코드의 변경이 없습니다.
- [Repository Interface](https://github.com/kibae/typeorm-sharding-repo/tree/main/src/repository-service/abstract-repository-service.ts)
- [Repository Interface](https://github.com/kibae/typeorm-sharding-repository/tree/main/src/repository-service/abstract-repository-service.ts)
```typescript
// 두 저장소 서비스는 동일한 인터페이스를 가지고 있습니다.
const typeormRepository = RepositoryService.of(MyEntityBasedOnTypeormBaseEntity);
Expand Down Expand Up @@ -126,7 +126,7 @@ interface AbstractRepositoryService<Entity> {
```

### 4. Entity [static] method
- [테스트 코드를 참조하세요.](https://github.com/kibae/typeorm-sharding-repo/blob/main/src/test/sharding-manager.spec.ts), [(Case1 Entity)](https://github.com/kibae/typeorm-sharding-repo/blob/main/src/test/entity/case1.ts)
- [테스트 코드를 참조하세요.](https://github.com/kibae/typeorm-sharding-repository/blob/main/src/test/sharding-manager.spec.ts), [(Case1 Entity)](https://github.com/kibae/typeorm-sharding-repository/blob/main/src/test/entity/case1.ts)
```typescript
// TypeORM.BaseEntity와 거의 동일한 기능들을 제공합니다.
const entity = await Case1.save({
Expand Down Expand Up @@ -205,6 +205,6 @@ Case1.getManager<Case1>(entity);
----

## Contributors
<a href="https://github.com/kibae/typeorm-sharding-repo/graphs/contributors">
<img src="https://contrib.rocks/image?repo=kibae/typeorm-sharding-repo" />
<a href="https://github.com/kibae/typeorm-sharding-repository/graphs/contributors">
<img src="https://contrib.rocks/image?repo=kibae/typeorm-sharding-repository" />
</a>
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# TypeORM Sharding Repository
- Enables TypeORM to be utilized in a distributed database environment.

[![Node.js CI](https://github.com/kibae/typeorm-sharding-repo/actions/workflows/node.js.yml/badge.svg)](https://github.com/kibae/typeorm-sharding-repo/actions/workflows/node.js.yml)
[![NPM Version](https://badge.fury.io/js/typeorm-sharding-repo.svg)](https://www.npmjs.com/package/typeorm-sharding-repo)
[![License](https://img.shields.io/github/license/kibae/typeorm-sharding-repo)](https://github.com/kibae/typeorm-sharding-repo/blob/main/LICENSE)
[![Node.js CI](https://github.com/kibae/typeorm-sharding-repository/actions/workflows/node.js.yml/badge.svg)](https://github.com/kibae/typeorm-sharding-repository/actions/workflows/node.js.yml)
[![NPM Version](https://badge.fury.io/js/typeorm-sharding-repository.svg)](https://www.npmjs.com/package/typeorm-sharding-repository)
[![License](https://img.shields.io/github/license/kibae/typeorm-sharding-repository)](https://github.com/kibae/typeorm-sharding-repository/blob/main/LICENSE)

## Install
- NPM
```shell
$ npm install typeorm-sharding-repo --save
$ npm install typeorm-sharding-repository --save
```

- Yarn
```shell
$ yarn add typeorm-sharding-repo
$ yarn add typeorm-sharding-repository
```

----
Expand Down Expand Up @@ -81,7 +81,7 @@ export class User extends ShardingBaseEntity {
### 3. RepositoryService (Abstract repository for TypeORM.BaseEntity and ShardingBaseEntity)
- `RepositoryService` compatible with TypeORM.BaseEntity and ShardingBaseEntity.
- With this pattern, changing whether or not sharding is applied does not change the code.
- [Repository Interface](https://github.com/kibae/typeorm-sharding-repo/tree/main/src/repository-service/abstract-repository-service.ts)
- [Repository Interface](https://github.com/kibae/typeorm-sharding-repository/tree/main/src/repository-service/abstract-repository-service.ts)
```typescript
// Both repository services have the same interface.
const typeormRepository = RepositoryService.of(MyEntityBasedOnTypeormBaseEntity);
Expand Down Expand Up @@ -126,8 +126,8 @@ interface AbstractRepositoryService<Entity> {
}
```

### 4. Use repository
- [This test code will help you.](https://github.com/kibae/typeorm-sharding-repo/blob/main/src/test/sharding-manager.spec.ts), [(Case1 Entity)](https://github.com/kibae/typeorm-sharding-repo/blob/main/src/test/entity/case1.ts)
### 4. Entity [static] method
- [This test code will help you.](https://github.com/kibae/typeorm-sharding-repository/blob/main/src/test/sharding-manager.spec.ts), [(Case1 Entity)](https://github.com/kibae/typeorm-sharding-repository/blob/main/src/test/entity/case1.ts)
```typescript
// Provides almost the same functionality as BaseEntity.
const entity = await Case1.save({
Expand Down Expand Up @@ -206,6 +206,6 @@ Case1.getManager<Case1>(entity);
----

## Contributors
<a href="https://github.com/kibae/typeorm-sharding-repo/graphs/contributors">
<img src="https://contrib.rocks/image?repo=kibae/typeorm-sharding-repo" />
<a href="https://github.com/kibae/typeorm-sharding-repository/graphs/contributors">
<img src="https://contrib.rocks/image?repo=kibae/typeorm-sharding-repository" />
</a>
Loading

0 comments on commit 2e02815

Please sign in to comment.