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

docs(contributing-cheatsheet): add new cheatsheet docs #14554

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mike-usa
Copy link
Contributor

Cheatsheet is an extenstion to CONTRIBUTING.md. This flavor focuses on the PostgreSQL dialect.

It covers:

  • Sequelize tests
    • prequisite steps
    • running various tests and expectations
    • debugging expectations
  • using docker (basic commands)
    • creating docker networks
    • inspecting docker containers
    • connecting containers to docker networks
  • setting up pgadmin4
    • running as a container
    • connecting it with database container
    • configuring pgadmin settings

This is not intended as a replacement to CONTRIBUTING.md, which contains must-read information. This document is intended as a quick guide targeting those new to Docker and Sequelize development. There is great opportunity for stylistic and content improvements.

Cheatsheet is an extenstion to CONTRIBUTING.md. This flavor focuses on the PostgreSQL dialect.

It covers:
- Sequelize tests
  - prequisite steps
  - running various tests and expectations
  - debugging expectations
- using docker (basic commands)
  - creating docker networks
  - inspecting docker containers
  - connecting containers to docker networks
- setting up pgadmin4
  - running as a container
  - connecting it with database container
  - configuring pgadmin settings

This is not intended as a replacement to CONTRIBUTING.md, which contains must-read information. This document is intended as a quick guide targeting those new to Docker and Sequelize development. There is great opportunity for stylistic and content improvements.
@mike-usa
Copy link
Contributor Author

There was a slight deviation here from #14539 in that I changed the name, thinking that other dialects might want to have their own -- perhaps MySQL and phpMyAdmin?

This wasn't intended to be a book or fully comprehensive, but I hope it helps others.

Copy link
Member

@ephys ephys left a comment

Choose a reason for hiding this comment

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

This is very thorough, really nice :)

A lot of it would work for the other dialects though, the only difference being the command name and which client needs to be installed

Do you think making this more generic (replacing pgAdmin4 Web with the desktop version so we can just link to their install page, and maybe mentioning other db clients like datagrip for the other dialects, and listing the possible commands for the different dialects) be still easy to understand?

---

## Helpful Notes and Explanations
1. Most scripts in _package.json_ use `yarn`, which is not a package.json dependency and must installed globally or available by some other means; for instance, it does not need to be specifically installed. Read on:
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be simpler to link to yarn's install documentation which explains all of this, as otherwise we'll have to keep this in sync with theirs :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Your call. I didn't realize it until you told me about it :) Since yarn is a dependency of the project (almost all npm scripts call it), but not included in the dev-dependencies, something needs to be stated as to why it wasn't included, or how to use it without installing it.

Linking to the documentation would be a good idea, but still need to be sure the links don't break in the future.

`docker exec -it <container name> psql -d sequelize_test -U sequelize_test` | Connect to a running database inside the container and run psql (psql is PostgreSQL-only)

### PgAdmin4
1. Running pgadmin4 as a container (pgadmin is PostgreSQL-only)
Copy link
Member

Choose a reason for hiding this comment

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

Setting up the web version of pgAdmin4 is pretty cumbersome, is there any reason to use it instead of the desktop client?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The CONTRIBUTING.md already included the docker code to start up pgadmin4; however, I couldn't get it working. That's why I included it here to mention how to get it working.

As for why I imagine that's going to be a preference. I know at my work, we are more limited on certain applications (or really the sockets) and think the web client would be a little less weight and bypass some of the more restrictive policies.

For my preference, I don't really use a GUI, just psql when necessary. I do think the configuration steps here may be of use to setting up other interfaces as it demonstrates how to work between the web and docker.

@mike-usa
Copy link
Contributor Author

Do you think making this more generic (replacing pgAdmin4 Web with the desktop version so we can just link to their install page, and maybe mentioning other db clients like datagrip for the other dialects, and listing the possible commands for the different dialects) be still easy to understand?

  • I think there's an opportunity to include other languages and nuances. As size grows, it would certainly need to be refactored and re-organized. I guess I kind of saw this as boilerplate to capture all that crucial information that you shared with this "NOOB".
  • For pgadmin4, I'm more inclined to want more info than to remove the things that were tricky for me to figure out -- much with your help :). I'm not familiar with some of the other databases and others I haven't used in 10 years, but yes I was hoping the power users would add their knowledge
  • Aside from a few Postgres-specific things and the examples being in Postgres (convenience), my goals was for it to be generic notes for using Sequelize, not particular to Postgres, but with the added language nuances/frustrations -- simple things like running tests and in what order even that prepare will compile src into lib and lib is what you're testing against. These are simple things to the experienced Sequelize developer, but it was a learning curve for me to look at it.

Note: I originally came here with a simple patch that I made to the files in node_modules and had to figure out the development process in order to copy that code to this repo. That's kind of what my goal was; to encourage contributions.

Copy link
Contributor

This pull request has been marked as maybe-abandoned and has not seen any activity for 14 days. It will be closed if no further activity occurs within the next 30 days. If you would still like to work on this, please comment to let us know and the label will be removed.

@github-actions github-actions bot added the stale label Feb 26, 2024
@WikiRik WikiRik self-assigned this Feb 26, 2024
@mike-usa mike-usa requested a review from a team as a code owner March 18, 2024 23:04
@mike-usa mike-usa requested review from ephys and WikiRik and removed request for a team March 18, 2024 23:04
@ephys
Copy link
Member

ephys commented Apr 11, 2024

@WikiRik as this is a bit outdated now, should I put it in draft until it's ready to be reviewed?

@WikiRik WikiRik marked this pull request as draft April 11, 2024 19:51
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.

None yet

3 participants