Canner / WrenAI

🚀 Open-source SQL AI Agent for Text-to-SQL. Make Text2SQL Easy! 🙌
https://getwren.ai/oss
GNU Affero General Public License v3.0
1.73k stars 155 forks source link

Mssql database connection #586

Closed johnfelipe closed 1 month ago

johnfelipe commented 1 month ago

Is possible connect with Mssql database?

cyyeh commented 1 month ago

@johnfelipe it's already supported in Wren AI. please refer to the docs for connection setup, thanks!

https://docs.getwren.ai/guide/connect/sqlserver

cyyeh commented 1 month ago

Also there is an issue using mssql, we will fix it asap

https://github.com/Canner/WrenAI/issues/581

johnfelipe commented 1 month ago

steps to perform these actions in a Windows environment using Docker and PowerShell. Here's how you can do it:

  1. Turn off all WrenAI-related containers: Open PowerShell and run:

    docker stop $(docker ps -q --filter "name=wrenai")
  2. Open PowerShell: You can do this by pressing Win + X and selecting "Windows PowerShell" or "Windows PowerShell (Admin)".

  3. Navigate to the WrenAI directory: In Windows, the ~/.wrenai directory is typically located in your user folder. Run:

    cd $env:USERPROFILE\.wrenai
  4. Rename .env to .env.txt:

    Rename-Item .env .env.txt
  5. Open .env.txt in Notepad:

    notepad .env.txt
  6. In Notepad, find the line with IBIS_SERVER_VERSION and change its value to msodbc-driver. Save the file and close Notepad.

  7. Rename .env.txt back to .env:

    Rename-Item .env.txt .env
  8. Run docker-compose with the updated .env file:

    docker-compose --env-file .env up -d

These steps should accomplish the tasks you've outlined in a Windows environment. Make sure you have the necessary permissions to modify files in the .wrenai directory and to run Docker commands.