Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client constructor #480

Merged
merged 16 commits into from Jun 30, 2020
Merged

Client constructor #480

merged 16 commits into from Jun 30, 2020

Conversation

mhwelander
Copy link
Contributor

Client constructor parameters page.

@mhwelander mhwelander linked an issue Jun 17, 2020 that may be closed by this pull request
…02-constructor.mdx

Co-authored-by: Tim Suchanek <Tim.Suchanek@gmail.com>
@Jolg42
Copy link
Member

Jolg42 commented Jun 17, 2020

Just a random question...

Netlify says here in GitHub Deploy preview ready but this page is blank https://deploy-preview-480--prisma2.netlify.app/docs/reference/tools-and-interfaces/prisma-client

So it's not possible to preview the PR I guess?

@mhwelander
Copy link
Contributor Author

@Jolg42 We have a bit of an issue with the /docs subdirectory - if you remove it, you can see the page: https://deploy-preview-480--prisma2.netlify.app/reference/tools-and-interfaces/prisma-client/

@Jolg42
Copy link
Member

Jolg42 commented Jun 17, 2020

@Jolg42
Copy link
Member

Jolg42 commented Jun 17, 2020

Spotted small things @mhwelander

Replace

  • prisma.schema by schema.prisma
  • Define a datasources by Define a datasource
    Weird indentation here

Screen Shot 2020-06-17 at 17 41 46

@mhwelander
Copy link
Contributor Author

Fixed - thank you! I'll wait for an update on whether the format of datasources will change.

@Jolg42
Copy link
Member

Jolg42 commented Jun 18, 2020

I broke something and fixed it but in the end the indentation looks better 😄

Copy link
Member

@janpio janpio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for prisma/prisma#2801

@janpio janpio self-requested a review June 19, 2020 11:32
})
```

> **Note**: If you define multiple datasources in `schema.prisma`, Prisma defaults to the first entry.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that? Do we not define which one it should be applied to by using my_database?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a enabled property in the schema before that got removed (never saw it, just the remains)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the connection to this comment? Should it not use the datasource with the name you supply above, my_database in this example?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually touching on undefined behavior, I think the Note is correct, but we need to fix that.
Even though you provide a specific datasource as a constructor arg, it could even be, that in our current implementation, it might not be used, if it's not the first datasource in the schema.
We don't have tests for that and didn't define this behavior clearly yet, but should definitely do that asap.

…02-constructor.mdx

Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
@mhwelander mhwelander added the docs Documentation creation, updates or corrections label Jun 24, 2020
@Jolg42
Copy link
Member

Jolg42 commented Jun 24, 2020

@janpio I think you can unblock that PR now 😃

@janpio janpio self-requested a review June 24, 2020 18:09
Copy link
Member

@janpio janpio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment left for the Note, rest looks good.

@mhwelander mhwelander merged commit c177960 into master Jun 30, 2020
@mhwelander mhwelander deleted the client-constructor branch June 30, 2020 14:08
@Jolg42
Copy link
Member

Jolg42 commented Jun 30, 2020

Yeah 🎊 😄

mhwelander added a commit that referenced this pull request Jul 2, 2020
* Added illustrations
Fixed some typos

* Client constructor page

* Constructor docs

* Fixed index

* Added # to page

* Update content/03-reference/01-tools-and-interfaces/02-prisma-client/02-constructor.mdx

Co-authored-by: Tim Suchanek <Tim.Suchanek@gmail.com>

* Joël fixes

* Update content/03-reference/01-tools-and-interfaces/02-prisma-client/02-constructor.mdx

* Update 02-constructor.mdx

* Update content/03-reference/01-tools-and-interfaces/02-prisma-client/02-constructor.mdx

Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>

Co-authored-by: Tim Suchanek <Tim.Suchanek@gmail.com>
Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com>
Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
mhwelander added a commit that referenced this pull request Jul 2, 2020
* Added illustrations
Fixed some typos

* Style guide wording

* Link fixes

* Enum binary

* Engine binaries

* Update content/02-understand-prisma/05-under-the-hood.mdx

* Update content/02-understand-prisma/05-under-the-hood.mdx

* Update content/02-understand-prisma/05-under-the-hood.mdx

Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>

* Update content/02-understand-prisma/05-under-the-hood.mdx

Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>

* Update content/02-understand-prisma/05-under-the-hood.mdx

Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>

* Update content/02-understand-prisma/05-under-the-hood.mdx

Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>

* Update content/02-understand-prisma/05-under-the-hood.mdx

Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>

* Client constructor (#480)

* Added illustrations
Fixed some typos

* Client constructor page

* Constructor docs

* Fixed index

* Added # to page

* Update content/03-reference/01-tools-and-interfaces/02-prisma-client/02-constructor.mdx

Co-authored-by: Tim Suchanek <Tim.Suchanek@gmail.com>

* Joël fixes

* Update content/03-reference/01-tools-and-interfaces/02-prisma-client/02-constructor.mdx

* Update 02-constructor.mdx

* Update content/03-reference/01-tools-and-interfaces/02-prisma-client/02-constructor.mdx

Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>

Co-authored-by: Tim Suchanek <Tim.Suchanek@gmail.com>
Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com>
Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>

* Fixes

* Fixes

* Fixes

Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com>
Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
Co-authored-by: Tim Suchanek <Tim.Suchanek@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation creation, updates or corrections
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow datasource credentials to be passed by client
5 participants