-
-
Notifications
You must be signed in to change notification settings - Fork 14
Not working correctly with projects using Vite #469
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
Comments
@angelvega93 please give more details, that's not enough.
How randomly, are you able to reproduce this by calling the same code several times, and sometimes it's broken and sometimes it's not?
Do you mean the file that calls
How do you modify it?
It's simple and straightforward, just two tables, a simple query, I can't imagine how the query becomes broken. |
Just modify database with empty space or something to trigger a Vite HMR Sometimes when modifying other files not related to database.ts brakes orchid maybe due to the same problem of vite HMR. |
One more thing, i don't know why but orchid seems to be really slow, even for simple queries. const user = await db.user.find(1); Takes around 45-50ms with orchid, while the same query with drizzle takes around 1-2ms, even when the table is completely empty. (57.7ms) SELECT "id", "name", "created_at" AS "createdAt", "updated_at" AS "updatedAt" FROM "users" WHERE "users"."id" = $1 LIMIT 1 [1]
(46.1ms) SELECT ...
(45.1ms) SELECT ...
(51.4ms) SELECT ...
(49.2ms) SELECT ...
(47.7ms) SELECT ...
(46.8ms) SELECT ... Any idea what could be causing the slowdown? EDIT: Only happens with SvelteKit (Vite), blank projects takes 1-2ms as drizzle. |
Thank you for finding the reasons and sharing solutions, so now we know there is a problem with HMR and it might require certain workarounds. I'll check on HMR and pg version some day later and will update the docs for it. |
Randomly or when modifying database file If the table has a relation orchid gets wrong query.
Repo with the example:
https://github.com/angelvega93/orchid-bug
Example Original query:
Example wrong query after modifying database.ts
The text was updated successfully, but these errors were encountered: