Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prisma/prisma-example-starter-template
https://github.com/prisma/prisma-example-starter-template
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/prisma/prisma-example-starter-template
- Owner: prisma
- Created: 2022-07-05T12:57:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-29T17:22:38.000Z (8 months ago)
- Last Synced: 2024-04-29T18:39:13.245Z (8 months ago)
- Size: 4.88 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# Prisma Example Title
Brief example intro/description – what does this example do and what stack is it built with
## Getting started
## Download and install dependencies
Clone this repository:
```
git clone [email protected]:/.git
```Install dependencies:
```
cd
npm i
```## Configure your project
## Create and seed the database
```
npm run seed
```## Evolving the app
Expand for an overview of example configurations with different databases
### PostgreSQL
For PostgreSQL, the connection URL has the following structure:
```prisma
datasource db {
provider = "postgresql"
url = "postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=SCHEMA"
}
```Here is an example connection string with a local PostgreSQL database:
```prisma
datasource db {
provider = "postgresql"
url = "postgresql://janedoe:mypassword@localhost:5432/notesapi?schema=public"
}
```### MySQL
For MySQL, the connection URL has the following structure:
```prisma
datasource db {
provider = "mysql"
url = "mysql://USER:PASSWORD@HOST:PORT/DATABASE"
}
```Here is an example connection string with a local MySQL database:
```prisma
datasource db {
provider = "mysql"
url = "mysql://janedoe:mypassword@localhost:3306/notesapi"
}
```### Microsoft SQL Server
Here is an example connection string with a local Microsoft SQL Server database:
```prisma
datasource db {
provider = "sqlserver"
url = "sqlserver://localhost:1433;initial catalog=sample;user=sa;password=mypassword;"
}
```### MongoDB
Here is an example connection string with a local MongoDB database:
```prisma
datasource db {
provider = "mongodb"
url = "mongodb://USERNAME:PASSWORD@HOST/DATABASE?authSource=admin&retryWrites=true&w=majority"
}
```
Because MongoDB is currently in [Preview](https://www.prisma.io/docs/about/releases#preview), you need to specify the `previewFeatures` on your `generator` block:```
generator client {
provider = "prisma-client-js"
previewFeatures = ["mongodb"]
}
```## Next steps
- Check out the [Prisma docs](https://www.prisma.io/docs)
- Create issues and ask questions on [GitHub](https://github.com/prisma/prisma/)## Contributing to this project