Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/myxogastria0808/cockroachdb-mytutorial
https://github.com/myxogastria0808/cockroachdb-mytutorial
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/myxogastria0808/cockroachdb-mytutorial
- Owner: Myxogastria0808
- License: wtfpl
- Created: 2024-04-12T16:59:37.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-04-13T13:42:04.000Z (8 months ago)
- Last Synced: 2024-04-14T16:14:36.230Z (8 months ago)
- Language: TypeScript
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CockroachDB × Prisma
## Setup
```shell
yarn
yarn compile
yarn migrate
yarn init:prisma
```# CRUD 操作
1. `index.ts`に操作内容を書く
2. 以下のコマンド実行
```shell
yarn compile
yarn start
```# テーブル構造
```mermaid
erDiagram
SampleRecordId ||--|| Sample : autoincrement
SampleRecordId {
BigInt cockroachdbId PK, UK "@id @default(autoincrement())"
BigInit id UK "@unique"
Tag tag "'LATEST' or 'OLD'"
Sample sample "actually Sample?"
}
Sample {
BigInt cockroachdbId PK, UK "@id @default(autoincrement())"
String title
String content
BigInt id FK, UK "@relation(fields: [id], references: [id]) @unique"
}
```