-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
introspect
fails on SQLite
#1648
Comments
I can reproduce It looks like the error is from the introspection engine, here is the SQL for this database from When I create a new sqlite database from this .sql I get the same error. PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "Group"
(
id integer not null
primary key autoincrement,
name varchar(255)
);
CREATE TABLE User
(
id integer not null
primary key autoincrement,
email varchar(255) not null,
password varchar(255) not null,
created_at datetime,
updated_at datetime
);
CREATE TABLE GroupToUser
(
user_id integer
references User,
group_id integer
references "Group"
);
DELETE FROM sqlite_sequence;
COMMIT; |
I think "Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed" is a follow up error when the Engine crashes. We might want to handle that better - you have a nice reproduction here ;) |
This comment has been minimized.
This comment has been minimized.
The output changed on alpha 927, I see "libs/sql-schema-describer/src/sqlite.rs:309:37" that wasn't there before.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Introspecting the SQL from #1648 (comment) I now got an error prompt: https://prisma-errors.netlify.com/report/2289 With
Relevant bit:
(Much better formatted in the error report link above) |
I haven't managed to get a readable error from the JS cli, but running the introspection engine directly, I get |
This was caused by a shortcut in the Sqlite foreign key definition btw. They allow you to write: Unfortunately the meta information calls then don't automatically provide the Information about the referenced column which caused the crash. This is now being handled. |
Awesome @do4gr 🚀 |
prisma/schema.prisma
:Zipped
1093.db
file to put in root of project:1093.zip
(originally via #1093 (comment))
When I run
prisma2 introspect
I get this:More info:
(preview 22 on Windows, but Harshit could reproduce on other platform)
The text was updated successfully, but these errors were encountered: