Skip to content

Commit

Permalink
feat(data): add prisma
Browse files Browse the repository at this point in the history
Fixes #16
  • Loading branch information
gjungb committed Jul 4, 2021
1 parent 6d170f6 commit 8536aee
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#using-environment-variables

# Prisma supports the native connection string format for PostgreSQL, MySQL, SQL Server and SQLite.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings

DATABASE_URL="file:../data/books.db"
Binary file added data/books.db
Binary file not shown.
Binary file added data/books.db-journal
Binary file not shown.
79 changes: 79 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@nestjs/core": "7.6.18",
"@nestjs/mapped-types": "*",
"@nestjs/platform-fastify": "7.6.18",
"@prisma/client": "^2.26.0",
"reflect-metadata": "0.1.13",
"rimraf": "3.0.2",
"rxjs": "6.6.7"
Expand All @@ -45,6 +46,7 @@
"eslint-plugin-prettier": "3.4.0",
"jest": "26.6.3",
"prettier": "2.3.2",
"prisma": "^2.26.0",
"supertest": "6.1.3",
"ts-jest": "26.5.6",
"ts-loader": "9.2.3",
Expand Down
5 changes: 5 additions & 0 deletions prisma/migrations/20210704085756_init/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- CreateTable
CREATE TABLE "Book" (
"id" TEXT NOT NULL PRIMARY KEY,
"isbn" TEXT NOT NULL
);
3 changes: 3 additions & 0 deletions prisma/migrations/migration_lock.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "sqlite"
16 changes: 16 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}

generator client {
provider = "prisma-client-js"
}

model Book {
id String @id @default(cuid())
isbn String
}

0 comments on commit 8536aee

Please sign in to comment.