Skip to content

Commit

Permalink
Merge pull request #148 from prisma/2.0.0-preview-1
Browse files Browse the repository at this point in the history
2.0.0 preview 1
  • Loading branch information
nikolasburk committed Jul 11, 2019
2 parents 8341112 + 56a848b commit c17c795
Show file tree
Hide file tree
Showing 12 changed files with 96 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -45,7 +45,7 @@ Learn more about the `prisma2 init` flow [here](./docs/getting-started.md) or ge
- Core
- Connectors
- [MySQL](./docs/core/connectors/mysql.md)
- [PostgreSQL](./docs/core/connectors/postgres.md)
- [PostgreSQL](./docs/core/connectors/postgresql.md)
- [SQLite](./docs/core/connectors/sqlite.md)
- [MongoDB](./docs/core/connectors/mongo.md)
- Generators
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Expand Up @@ -14,7 +14,7 @@
- Core
- Connectors
- [MySQL](./core/connectors/mysql.md)
- [PostgreSQL](./core/connectors/postgres.md)
- [PostgreSQL](./core/connectors/postgresql.md)
- [SQLite](./core/connectors/sqlite.md)
- [MongoDB](./core/connectors/mongo.md)
- Generators
Expand Down
Expand Up @@ -8,7 +8,7 @@ To connect to a PostgreSQL database server, you need to configure a [`datasource

```groovy
datasource pg {
provider = "postgres"
provider = "postgresql"
url = env("POSTGRES_URL")
}
Expand Down Expand Up @@ -64,7 +64,7 @@ postgresql://[user[:password]@][netloc][:port][,...][/database][?param1=value1&.
- `host`: The IP address/domain of your database server, e.g. `localhost`.
- `port`: The port on which your database server listens, e.g. `5432`.
- `database`: The name of the database with the target schema.
- `schema`: The name of the target schema.
- `schema`: The name of the target schema. Default: `public`.
- `user`: The database user, e.g. `admin`.
- `password`: The password for the database user.
- `ssl`: Whether or not your database server uses SSL.
Expand Down
13 changes: 13 additions & 0 deletions docs/core/generators/photonjs.md
Expand Up @@ -66,3 +66,16 @@ The Photon JS generator provides the following mapping from data model [scalar t
| `Int` | `number` |
| `Float` | `number` |
| `Datetime` | `Date` |

## Reserved model names

When generating Photon JS based on your [data model definition](./data-modeling.md#data-model-definition), there are a number of reserved names that you can't use for your models. Here is a list of the reserved names:

- `String`
- `Int`
- `Float`
- `Subscription`
- `DateTime`
- `WhereInput`
- `IDFilter`
- `StringFilter`
17 changes: 16 additions & 1 deletion docs/data-modeling.md
Expand Up @@ -11,6 +11,7 @@
- [Functions](#functions)
- [Scalar types](#scalar-types)
- [Relations](#relations)
- [Reserved model names](#reserved-model-names)

## Data model definition

Expand Down Expand Up @@ -374,7 +375,7 @@ _Connector_ attributes let you use the native features of your data source. With
Here is where you can find the documentation of connector attributes per data source connector:

- [MySQL](./core/connectors/mysql.md)
- [PostgreSQL](./core/connectors/postgres.md)
- [PostgreSQL](./core/connectors/postgresql.md)
- [SQLite](./core/connectors/sqlite.md)
- [MongoDB](./core/connectors/mongo.md)

Expand Down Expand Up @@ -449,3 +450,17 @@ close.
## Relations

Learn more about relations [here](./relations.md).

## Reserved model names

When generating Photon JS based on your [data model definition](./data-modeling.md#data-model-definition), there are a number of reserved names that you can't use for your models. Here is a list of the reserved names:

- `String`
- `Int`
- `Float`
- `Subscription`
- `DateTime`
- `WhereInput`
- `IDFilter`
- `StringFilter`

2 changes: 1 addition & 1 deletion docs/faq.md
Expand Up @@ -31,7 +31,7 @@ Photon acts more as a _query builder_ returning plain objects with a focus on st

### Will Photon support more databases (and other data sources) in the future?

Yes. Photon is based on Prisma's query engine that can connect to any data source that provides a proper connector implementation. There will be built-in connectors such as the current ones for [PostgreSQL](./core/connectors/postgres.md), [MySQL](./core/connectors/mysql.md) and [SQLite](./core/connectors/sqlite.md).
Yes. Photon is based on Prisma's query engine that can connect to any data source that provides a proper connector implementation. There will be built-in connectors such as the current ones for [PostgreSQL](./core/connectors/postgresql.md), [MySQL](./core/connectors/mysql.md) and [SQLite](./core/connectors/sqlite.md).

However, it's also possible to build your own connectors, more documentation on that topic will follow soon.

Expand Down
2 changes: 1 addition & 1 deletion docs/glossary.md
Expand Up @@ -47,7 +47,7 @@ A data source connector connects Prisma to a [data source](#data-source).
Prisma currently supports the following built-in connectors:

- [`sqlite`](./core/connectors/sqlite.md): A connector for SQLite databases
- [`postgres`](./core/connectors/postgres.md): A connector for PostgreSQL databases
- [`postgresql`](./core/connectors/postgresql.md): A connector for PostgreSQL databases
- [`mysql`](./core/connectors/mysql.md): A connector for MySQL databases
- [`mongo`](./core/connectors/mongo.md): A connector for MongoDB databases (_coming soon_)

Expand Down
36 changes: 36 additions & 0 deletions docs/photon/deployment.md
Expand Up @@ -28,3 +28,39 @@ Note that `darwin` is the default `target`. Here's a list of supported platforms
| Google Cloud Functions | User's choice |

> **ATTENTION**: The `target` field on the `generator` block is not yet implemented. You can track the progress of the implementation [on GitHub](https://github.com/prisma/prisma2/issues/97). You can also check ou the [specification](https://github.com/prisma/specs/tree/master/binary-workflows) for more details.
## Hosting providers

### ZEIT Now

You can deploy your "Photon JS"-based application to [ZEIT Now](https://zeit.co/now).

When deploying to ZEIT Now, you must configure the following in your `now.json`:

- `use`: `@now/node@canary`
- `maxLambdaSize`: `25mb`

Here is an example `now.json`:

```json
{
"version": 2,
"builds": [
{
"src": "index.js",
"use": "@now/node@canary",
"config": {
"maxLambdaSize": "25mb"
}
}
],
"routes": [
{
"src": "/(.*)",
"dest": "index.js"
}
]
}
```

You can find an example for a ZEIT Now deployment [here](https://github.com/prisma/photonjs/tree/master/examples/javascript/now).
10 changes: 5 additions & 5 deletions docs/prisma-schema-file.md
Expand Up @@ -73,7 +73,7 @@ A data source can be specified using a `datasource` block in the schema file.

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| `provider` | **Yes** | Enum (`postgres`, `mysql`, `sqlite`) | Describes which data source connector to use. |
| `provider` | **Yes** | Enum (`postgresql`, `mysql`, `sqlite`) | Describes which data source connector to use. |
| `url` | **Yes** | String (URL) | Connection URL including authentication info. Each data source connector documents the URL syntax. Most connectors use the syntax provided by the database. |
| `enabled` | No | Boolean | Use environment variables to enable/disable a data source. **Default**: `true`. |

Expand All @@ -94,8 +94,8 @@ datasource mysql {
url = env("SQLITE_URL")
}
datasource postgres {
provider = "postgres"
datasource postgresql {
provider = "postgresql"
url = env("SQLITE_URL")
}
Expand All @@ -112,7 +112,7 @@ This is just a general convention, technically data sources can be named anythin

```groovy
datasource pg {
provider = "postgres"
provider = "postgresql"
url = env("POSTGRES_URL")
enabled = true
}
Expand Down Expand Up @@ -196,7 +196,7 @@ Environment variables can be provided using the `env` function:

```
datasource pg {
provider = "postgres"
provider = "postgresql"
url = env("POSTGRES_URL")
}
```
Expand Down
3 changes: 2 additions & 1 deletion docs/prisma2-feedback.md
Expand Up @@ -62,8 +62,9 @@ Once you created a GitHub issue, feel free to post it in the [`#prisma2-preview`
We are extremely eager to get your feedback! Please feel free to reach out to us personally during the Preview period if you can't find an appropriate place for your specific feedback.

<a href="mailto:schickling@prisma.io?subject=Prisma 2 Feedback for Johannes"><img width="75px" style="border-radius:50%;" alt="Email us" src="https://pbs.twimg.com/profile_images/670932364491669504/N4-NLlZ0_400x400.jpg"></a>
<a href="mailto:sverdlov@prisma.io?subject=Prisma 2 Feedback for Etel"><img width="75px" style="border-radius:50%;" alt="Email us" src="https://pbs.twimg.com/profile_images/1139455302988914688/VleSmw1Q_400x400.png"></a>
<a href="mailto:mueller@prisma.io?subject=Prisma 2 Feedback for Matt"><img width="75px" style="border-radius:50%;" alt="Email us" src="https://pbs.twimg.com/profile_images/1067441283558367232/X3T81W8I_400x400.jpg"></a>
<a href="mailto:suchanek@prisma.io?subject=Prisma 2 Feedback for Tim"><img width="75px" style="border-radius:50%;" alt="Email us" src="https://pbs.twimg.com/profile_images/1046724373472845824/RecM9fcC_400x400.jpg"></a>
<a href="mailto:singh@prisma.io?subject=Prisma 2 Feedback for Divyendy"><img width="75px" style="border-radius:50%;" alt="Email us" src="https://pbs.twimg.com/profile_images/1136464314083287040/nIocY54I_400x400.jpg"></a>
<a href="mailto:panth@prisma.io?subject=Prisma 2 Feedback for Harshit"><img width="75px" style="border-radius:50%;" alt="Email us" src="https://pbs.twimg.com/profile_images/1142528238566162432/HWghFOWd_400x400.jpg"></a>
<a href="mailto:burk@prisma.io?subject=Prisma 2 Feedback for Nikolas"><img width="75px" style="border-radius:50%;" alt="Email us" src="https://pbs.twimg.com/profile_images/938876572802650112/owTdBnzU_400x400.jpg"></a>
<a href="mailto:burk@prisma.io?subject=Prisma 2 Feedback for Nikolas"><img width="75px" style="border-radius:50%;" alt="Email us" src="https://pbs.twimg.com/profile_images/938876572802650112/owTdBnzU_400x400.jpg"></a>
12 changes: 6 additions & 6 deletions docs/tutorial.md
Expand Up @@ -113,18 +113,18 @@ Your Prisma schema file currently has the following contents:

```prisma
datasource db {
provider = "postgres"
provider = "postgresql"
url = "postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=SCHEMA"
}
```

The uppercase letters are placeholders representing your database credentials.

For a PostgreSQL database hosted on Heroku, the [connection string](./core/connectors/postgres.md#connection-string) might look as follows:
For a PostgreSQL database hosted on Heroku, the [connection string](./core/connectors/postgresql.md#connection-string) might look as follows:

```prisma
datasource db {
provider = "postgres"
provider = "postgresql"
url = "postgresql://opnmyfngbknppm:XXX@ec2-46-137-91-216.eu-west-1.compute.amazonaws.com:5432/d50rgmkqi2ipus?schema=hello-prisma2"
}
```
Expand All @@ -133,7 +133,7 @@ When running PostgreSQL locally, your user and password as well as the database

```prisma
datasource db {
provider = "postgres"
provider = "postgresql"
url = "postgresql://johndoe:johndoe@localhost:5432/johndoe?schema=hello-prisma2"
}
```
Expand Down Expand Up @@ -267,7 +267,7 @@ To generate Photon, you first need to add a `generator` to your schema file. Go

```diff
datasource db {
provider = "postgres"
provider = "postgresql"
url = "postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=SCHEMA"
}

Expand Down Expand Up @@ -576,4 +576,4 @@ prisma2 lift up

## 9. Explore Photon's relation API

Coming soon.
Coming soon. In the meantime, you can learn more about Photon's relations API [here](./relations.md#relations-in-the-generated-photon-api).
15 changes: 12 additions & 3 deletions releases/README.md
@@ -1,17 +1,26 @@
# Releases

This page explains the release process for Prisma 2.

## Release log

- [`preview-1`](https://github.com/prisma/prisma/releases/tag/2.0.0-preview-1) (July 11, 2019)
- `preview-2` (July 18, 2019)

## Release channels

There are two main release channels:

- **Preview**: Weekly releases on Thursdays
- **Alpha**: Rolling releases
- **Alpha**: Rolling/continuous releases

Unless you have specific requirements for the alpha channel, it is recommended to always use the latest Preview release.

### Preview

Prisma 2 has a **weekly release cycle** where new Preview releases are issued **on Thursdays**. Preview releases are named `preview-1`, `preview-2`, `preview-3`, ...
Prisma 2 has a **weekly release cycle** where new Preview releases are issued **on Thursdays**.

Preview releases are named `2.0.0-preview-1`, `2.0.0-preview-2`, `2.0.0-preview-3`, ... or you can reference them for short: `preview-1`, `preview-2`, `preview-3` ...

You can install the latest Preview release via npm:

Expand All @@ -29,4 +38,4 @@ You can install the latest alpha release via npm:

```
npm install -g prisma2@alpha
```
```

0 comments on commit c17c795

Please sign in to comment.