You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Introspection fails: "This function must not be called on compound database names." (report 1301) #1409
While introspecting with prisma2 (preview20).
The error is pretty generic, I don't know what part of the schema fails.
Schema parsing
thread 'main' panicked at 'This function must not be called on compound database names.', libs/datamodel/core/src/dml/traits.rs:14:13
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
1: backtrace::backtrace::trace_unsynchronized
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print_fmt
at src/libstd/sys_common/backtrace.rs:77
3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
at src/libstd/sys_common/backtrace.rs:61
4: core::fmt::write
at src/libcore/fmt/mod.rs:1028
5: std::io::Write::write_fmt
at src/libstd/io/mod.rs:1412
6: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:65
7: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:50
8: std::panicking::default_hook::{{closure}}
Thank you very much for this bug report, I can reproduce the output you posted with the data included in the error report - so we can now look into this.
It's the first time I see an error message like this, so I will ask my colleagues what is going on here.
changed the title [-]Introspection fails, report 1301[/-][+]Introspection fails, report 1301: This function must not be called on compound database names.[/+]on Jan 22, 2020
changed the title [-]Introspection fails, report 1301: This function must not be called on compound database names.[/-][+]Introspection fails: "This function must not be called on compound database names." (report 1301)[/+]on Jan 22, 2020
This happens when IE finds a FK that is backed by 2 columns (table user, columns first_name, last_name)
It creates 1 relation field out of it with an auto generated name, and is backed by 2 actual database columns (user @relation(references: [first_name, last_name]) @map([user_first_name, user_last_name])) ("database name" = [user_first_name, user_last_name])
When QE code wants to retrieve the "database name" for that relation field, it can't handle the because it gets 2 names instead of 1
Hey @tontonrally, could you use the current alpha version of Prisma to Introspect again? This is probably not fixed yet, but the behavior might be different and it might be interesting for us to know what exactly is happening right now.
It would also be super awesome if you could send us your underlying SQL schema to [email protected] (happy to sign an NDA if necessary) so we can easier reproduce this ourselves <3
I just tried prisma2 validate and prisma2 generate with the schema the error report contained @tontonrally, and I could successfully validate and generate a Prisma Client - so this might indeed be fixed. Possibly the introspect command itself will still fail, but I need either your help in trying that or you send us the schema.
On the other hand I just looked through the schema from the error report for cases like described in the note above - and could not find any. So maybe I am looking in the wrong place completely...
In order to inform, I didn't manage to get things working with the alpha branch, I tried a week ago. But, with the preview023, I manage to do the introspection without errors + generate the client and connect to the db. 👌
Activity
janpio commentedon Jan 22, 2020
Thank you very much for this bug report, I can reproduce the output you posted with the data included in the error report - so we can now look into this.
It's the first time I see an error message like this, so I will ask my colleagues what is going on here.
[-]Introspection fails, report 1301[/-][+]Introspection fails, report 1301: This function must not be called on compound database names.[/+][-]Introspection fails, report 1301: This function must not be called on compound database names.[/-][+]Introspection fails: "This function must not be called on compound database names." (report 1301)[/+]janpio commentedon Feb 4, 2020
Internal Note:
user, columnsfirst_name,last_name)user @relation(references: [first_name, last_name]) @map([user_first_name, user_last_name])) ("database name" =[user_first_name, user_last_name])janpio commentedon Feb 18, 2020
Hey @tontonrally, could you use the current
alphaversion of Prisma to Introspect again? This is probably not fixed yet, but the behavior might be different and it might be interesting for us to know what exactly is happening right now.It would also be super awesome if you could send us your underlying SQL schema to [email protected] (happy to sign an NDA if necessary) so we can easier reproduce this ourselves <3
janpio commentedon Feb 18, 2020
I just tried
prisma2 validateandprisma2 generatewith the schema the error report contained @tontonrally, and I could successfully validate and generate a Prisma Client - so this might indeed be fixed. Possibly theintrospectcommand itself will still fail, but I need either your help in trying that or you send us the schema.On the other hand I just looked through the schema from the error report for cases like described in the note above - and could not find any. So maybe I am looking in the wrong place completely...
tontonrally commentedon Mar 11, 2020
@janpio sorry mate, I had no time
In order to inform, I didn't manage to get things working with the alpha branch, I tried a week ago. But, with the preview023, I manage to do the introspection without errors + generate the client and connect to the db. 👌
Thanks
janpio commentedon Mar 11, 2020
Thanks for the update, important thing is that it now works for you <3