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

refactor(client): rename Client to Prisma #267

Closed
wants to merge 5 commits into from

Conversation

kivo360
Copy link
Contributor

@kivo360 kivo360 commented Feb 3, 2022

Change Summary

This was only a client name change. I made the changes inside of init.py. Instead of just referencing client I created an inherited client to update the representation. The class Client was changed to Prisma and the instance client was changed to conn within the docs.

Closes #205.

Checklist

  • Unit tests for the changes exist
  • Tests pass without significant drop in coverage
  • Documentation reflects changes where applicable
  • Test snapshots have been updated if applicable

Agreement

By submitting this pull request, I confirm that you can use, modify, copy and redistribute this contribution, under the terms of your choice.

The change should be non-breaking. The main priority is ensuring the naming changes through tests and examples.
Tests and docs should be fully up to date.
docs(client): Renamed `client` and `Client` into conn and `Prisma`.
@RobertCraigie RobertCraigie changed the title Client name refactor(client): rename Client to Prisma Feb 3, 2022
@codecov
Copy link

codecov bot commented Feb 3, 2022

Codecov Report

Merging #267 (f614d70) into main (44803e8) will decrease coverage by 57.55%.
The diff coverage is 31.03%.

❗ Current head f614d70 differs from pull request most recent head d36adc6. Consider uploading reports for the commit d36adc6 to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #267       +/-   ##
===========================================
- Coverage   96.76%   39.20%   -57.56%     
===========================================
  Files         111      103        -8     
  Lines        5433     5298      -135     
  Branches      320      314        -6     
===========================================
- Hits         5257     2077     -3180     
- Misses        130     3144     +3014     
- Partials       46       77       +31     
Impacted Files Coverage Δ
src/prisma/cli/commands/dev.py 0.00% <0.00%> (-52.39%) ⬇️
tests/test_batch.py 0.00% <0.00%> (-100.00%) ⬇️
tests/test_client.py 0.00% <0.00%> (-100.00%) ⬇️
tests/test_count.py 0.00% <0.00%> (-100.00%) ⬇️
tests/test_create.py 0.00% <0.00%> (-100.00%) ⬇️
tests/test_delete.py 0.00% <0.00%> (-100.00%) ⬇️
tests/test_delete_many.py 0.00% <0.00%> (-100.00%) ⬇️
tests/test_dotenv.py 0.00% <0.00%> (-100.00%) ⬇️
tests/test_engine.py 1.51% <0.00%> (-98.49%) ⬇️
tests/test_find_first.py 0.00% <0.00%> (-100.00%) ⬇️
... and 113 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44803e8...d36adc6. Read the comment docs.

@RobertCraigie
Copy link
Owner

@kivo360 thank you!

Couple nitpicks:

  • I would prefer either a mix of using db and prisma or just prisma instead of conn as the client instance name in documentation / examples (I know I said there were downsides to this in the original issue but I do actually quite like using prisma as the name)
  • the prisma.http module should not be commited unless you are actually changing code in the pre-generation state (this module is automatically replaced during generation time by the client)

What is the reasoning for inheriting from the Client class? I originally thought the best solution would be to rename it to Prisma and simply make an alias to the new class, e.g.

class Prisma:
    ...

Client = Prisma

This means that anyone wanting to still use the old Client name can still do so with no changes as far as I am aware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename Client to Prisma
2 participants