-
Notifications
You must be signed in to change notification settings - Fork 3
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
Model types not returned from findMany #1
Comments
Thanks for the heads up @Gherdty ! Will take a look when I get a chance, hoping to play around with this project this weekend to see if it works with Prisma 5 as well, so hopefully I can get this fixed when I do that. |
Seeing the same issue on my end. Temporarily, if anyone else is running into this, you can cast the type as a workaround: import { PrismaClientPostgres } from '@prismany/client';
import { type PostgresModel } from '@prismany/client/postgres';
const manyWithType = (await postgres.postgresModel.findMany()) as PostgresModel[]; Definitely not an acceptable solution, but it's an option temporarily while I work on getting this fixed. Thanks again for catching this! |
Should be fixed with version Let me know if you get a chance to try it out @Gherdty Tested with Prisma 5 and that seems to be working for me as well 😄 |
just left a comment here: prisma/prisma#2443 (comment) then saw this issue lol, how do i force using the latest version when running with npx? edit: Actually i am using but running
edit 2: using
|
Thanks for bringing this up @safejace ! Hmm, I don't usually use pnpm, and I've never used pnpx. Can you try adding the the package to your dev dependencies? npx looks in
Should be 1.0.2 |
I guess it's possible the second error could be a totally new, unrelated bug with prismany. Do you not get those missing files with [email protected]? |
hmmm. ya i seem to be getting the same errors now with 1.0.0 though in the readme, it makes no metion of installing prismany as a dev dependancy. is that expected? i know nuxt does a lot of magic with autoimports. so it's possible that it's a nuxt issue. i just don't know how to override/fix it |
afaik, pnpx should work the same as npx but im not super experience with these things |
it's entirely possible that it was never working. i was just looking in the ide for the type checking before even running the site. but when i run
which is vastly different form other import of other packages. eg:
etc |
Hm, yeah it sounds like an issue with how it's getting bundled with Nuxt specifically. If you just do Did you try deleting |
deleting .nuxt and restarting doesnt fix anything. it gets overidden every time i start the server yes, using prisma works the function is imported as expected:
so i just followed the steps from prisma/prisma#2443 (comment) and it worked. so im not sure what your package is doing, but its slighty different than prisma regardless, its working for me now. your package would be more convenient ofc something you could look into, i can help where i can, if you would like to try to support it :D edit: |
Very excited at the prospect of this CLI. I am finding that the findMany function is not returning the model types from my schema.
In the example project I have changed
findFirst
tofindMany
:const sqliteRes = await sqlite.sqliteModel.findMany();
The type for the variable thats returned then becomes:
const sqliteRes: runtime.Types.Public.PrismaPromise<T>
It looks like all other functions are working besides findMany.
The text was updated successfully, but these errors were encountered: