Mintplex-Labs / vector-admin

The universal tool suite for vector database management. Manage Pinecone, Chroma, Qdrant, Weaviate and more vector databases with ease.
https://vectoradmin.com/
MIT License
1.01k stars 173 forks source link

Environment variable not found: DATABASE_CONNECTION_STRING. #111

Closed kh-ac closed 5 months ago

kh-ac commented 5 months ago

Hi, While trying to setup the project locally on my machine, I am getting this error when running the script: yarn prisma:setup Screenshot from 2024-01-07 18-47-40

Environment

kh-ac commented 5 months ago

@timothycarambat I did some research and i found that Prisma read environment vars from a .env file by default and in case we want to work with multiple .env files there is a configuration that has to be done. So I had to add the following to the prisma:migrate in order to run the yarn prisma:setup command successfully:

Screenshot from 2024-01-08 16-38-02

If this is an issue that has to be solved, I am ready to work on it.

timothycarambat commented 5 months ago

This was still the case after running yarn devSetup? https://github.com/Mintplex-Labs/vector-admin/blob/e7659c94476cb3329cb3ade9f5a49cc9915d99d3/devSetup.js#L11

Which is supposed to set up a server .env and have the variable in it (to a default string that can be modified)

kh-ac commented 5 months ago

This was still the case after running yarn devSetup?

https://github.com/Mintplex-Labs/vector-admin/blob/e7659c94476cb3329cb3ade9f5a49cc9915d99d3/devSetup.js#L11

Which is supposed to set up a server .env and have the variable in it (to a default string that can be modified)

Yes, after running yarn dev:setup script just the .env.development file is created as mentioned in here : https://github.com/Mintplex-Labs/vector-admin/blob/e7659c94476cb3329cb3ade9f5a49cc9915d99d3/devSetup.js#L11-L16

But i think Prisma expects a .env by default not .env.something, i had to either create an .env file manually and write my environment variables or set the .env file for Prisma like that : Screenshot from 2024-01-08 16-38-02

timothycarambat commented 5 months ago

You are correct, i updated the dev:setup to create both files now or else it is totally unclear that that backend/.env is required. Of course, the user still needs to update the connection string to be correct, but it is less ambiguous now and the prisma commands will use that connection in the backend/.env now.