prisma / prisma1

💾 Database Tools incl. ORM, Migrations and Admin UI (Postgres, MySQL & MongoDB) [deprecated]
https://v1.prisma.io/docs/
Apache License 2.0
16.55k stars 862 forks source link

Improve CLI wording #4041

Closed nikolasburk closed 5 years ago

nikolasburk commented 5 years ago

The CLI wording can be improved.

nikolasburk commented 5 years ago
nikolasburk commented 5 years ago
❯ Demo server + MySQL database           Free demo environment hosted in Prisma Cloud 
nikolasburk commented 5 years ago
version: '3'
services:
  prisma:
    image: prismagraphql/prisma:1.30-alpha
    restart: always
    ports:
    - "4466:4466"
    environment:
      PRISMA_CONFIG: |
        port: 4466
        # Uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
        # managementApiSecret: my-secret
        prototype: true
        databases:
          default:
            connector: postgres
            host: postgres
            user: prisma
            password: prisma
            port: 5432
  postgres:
    image: postgres
    restart: always
    # Uncomment the next line to connect to your your database from outside the Docker environment, e.g. using a database GUI like Postico
    # ports:
    # - "5432:5432"
    environment:
      POSTGRES_USER: prisma
      POSTGRES_PASSWORD: prisma
    volumes:
      - postgres:/var/lib/postgresql/data
volumes:
  postgres:

Note that Uncomment should be uppercased in both comments.

nikolasburk commented 5 years ago
nikolasburk commented 5 years ago

Context: Both commands will not be further developed in the future. For large data sets, it is recommended to use native import/export features of the underlying database.

When running the prisma import or prisma export command, the CLI should print the following warning (after the warning was printed, the command should be executed as usual):

This is for prisma import with MySQL:

Warning: The `prisma import` command will not be further developed in the future. Please use the native import features of your database for these workflows. 

More info here: https://dev.mysql.com/doc/refman/5.7/en/mysqlimport.html 

This is for prisma export with MySQL:

Warning: The `prisma export` command will not be further developed in the future. Please use the native export features of your database for these workflows. 

More info here: https://dev.mysql.com/doc/refman/5.7/en/mysqlpump.html

The links vary other database connectors:

divyenduz commented 5 years ago

The generated docker-compose.yml from running prisma init should have an additional commented line

Adding specific ports/client names for this per DB. This is the related code:

const databaseServiceDefinitions = {
  postgres: `
  postgres:
    image: postgres
    restart: always
    # Uncomment the next line to connect to your your database from outside the Docker environment, e.g. using a database GUI like Postico
    # ports:
    # - "5432:5432"
    environment:
      POSTGRES_USER: prisma
      POSTGRES_PASSWORD: prisma
    volumes:
      - postgres:/var/lib/postgresql/data
volumes:
  postgres:
`,
  mysql: `
  mysql:
    image: mysql:5.7
    restart: always
    # Uncomment the next line to connect to your your database from outside the Docker environment, e.g. using a database GUI like Workbench
    # ports:
    # - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: prisma
    volumes:
      - mysql:/var/lib/mysql
volumes:
  mysql:
`,
  mongo: `
  mongo:
    image: mongo:3.6
    restart: always
    # Uncomment the next line to connect to your your database from outside the Docker environment, e.g. using a database GUI like Compass
    # ports:
    # - "27017:27017"
    environment:
      MONGO_INITDB_ROOT_USERNAME: prisma
      MONGO_INITDB_ROOT_PASSWORD: prisma
    ports:
      - "27017:27017"
    volumes:
      - mongo:/var/lib/mongo
volumes:
  mongo:`,
}
divyenduz commented 5 years ago

All of the feedback here is implemented and is available in stable now.

Fi1osof commented 4 years ago
  • [x] Warning for prisma import and prisma export

Context: Both commands will not be further developed in the future. For large data sets, it is recommended to use native import/export features of the underlying database.

When running the prisma import or prisma export command, the CLI should print the following warning (after the warning was printed, the command should be executed as usual):

This is for prisma import with MySQL:

Warning: The `prisma import` command will not be further developed in the future. Please use the native import features of your database for these workflows. 

More info here: https://dev.mysql.com/doc/refman/5.7/en/mysqlimport.html 

This is for prisma export with MySQL:

Warning: The `prisma export` command will not be further developed in the future. Please use the native export features of your database for these workflows. 

More info here: https://dev.mysql.com/doc/refman/5.7/en/mysqlpump.html

The links vary other database connectors:

Please, do not remove import/export comand. It's powerfull tool. With this i managed upgrade old prisma-1.15 to latest prisma-1.30 With native mysqldump + mysqlimport i can not do this cause tables different (became 75 instead 202 after upgrade :))