Code Monkey home page Code Monkey logo

Comments (7)

liamdanielduffy avatar liamdanielduffy commented on May 11, 2024 1

@mavilein @schickling @timsuchanek

Reproduction here: https://github.com/liamdanielduffy/prisma2-postgres-issue-repro

Steps are:

  1. Install dependencies with yarn or npm install
  2. Make sure the docker image for postgres is available locally with docker pull postgres
  3. In the root of the directory, run yarn setup-db or npm run setup-db
  4. In the root of the directory, run prisma2 dev

from prisma.

mavilein avatar mavilein commented on May 11, 2024 1

So the error indicates that the schema param is missing in the connection URL. E.g. this URL is not enough as of now:

postgresql://postgres:password@localhost:5432/db

It would be have to be something like this:

postgresql://postgres:password@localhost:5432/db?schema=my_schema

We could make this parameter optional and default to the public schema in this case. Does that change sound good?

from prisma.

matthewmueller avatar matthewmueller commented on May 11, 2024

Also ran into this, here are the steps:

  1. Create a project.prisma

project.prisma

datasource pg {
  provider = "postgres"
  url      = "file:jack.db"
}
  1. Run prisma dev
  2. Click on http://localhost:5555/
Error: Error in lift engine for rpc listMigrations:
  thread 'main' panicked at 'schema param is missing', src/libcore/option.rs:1038:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::_print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::continue_panic_fmt
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::option::expect_failed
   9: sql_migration_connector::SqlMigrationConnector::postgres_helper
  10: sql_migration_connector::SqlMigrationConnector::exists
  11: migration_core::connector_loader::load_connector
  12: migration_core::migration_engine::MigrationEngine::init
  13: <F as jsonrpc_core::calls::RpcMethodSimple>::call
  14: <F as jsonrpc_core::calls::RpcMethod<T>>::call
  15: <futures::future::lazy::Lazy<F, R> as futures::future::Future>::poll
  16: <futures::future::then::Then<A, B, F> as futures::future::Future>::poll
  17: <futures::future::map::Map<A, F> as futures::future::Future>::poll
  18: <futures::future::either::Either<A, B> as futures::future::Future>::poll
  19: futures::task_impl::std::set
  20: <std::thread::local::LocalKey<T>>::with
  21: futures::future::Future::wait
  22: <jsonrpc_core::io::IoHandler<M>>::handle_request_sync
  23: migration_core::rpc_api::RpcApi::handle
  24: migration_engine::main
  25: std::rt::lang_start::{{closure}}
  26: std::panicking::try::do_call
  27: __rust_maybe_catch_panic
  28: std::rt::lang_start_internal
  29: main

There is no migrations/ folder currently

from prisma.

matthewmueller avatar matthewmueller commented on May 11, 2024

Happens on save to the project.prisma too

from prisma.

mavilein avatar mavilein commented on May 11, 2024

This is not actionable right now.
The bug description by @schickling does not show the datasource configuration. Hence no reproduction is possible.
The description by @matthewmueller uses provider postgres with a file url. This should have been rejected at some point. The proper source validation is not implemented yet.

from prisma.

schickling avatar schickling commented on May 11, 2024

Yes, I think that‘s a great suggestion @mavilein.

@nikolasburk please make sure we also cover this accordingly in our docs.

from prisma.

mavilein avatar mavilein commented on May 11, 2024

This got fixed in: 818accd
Will be available through tomorrows release.

from prisma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.