This Node.js script analyzes SQL migration files using OpenAI's GPT-4 model and sends the analysis to Microsoft Teams.
- Node.js installed
- OpenAI API key
- Microsoft Teams webhook URL
-
Clone the repository:
git clone <repository-url> cd SQL-Analyzer
-
Install dependencies:
npm install
- Replace
your_openai_api_keyinanalyze-sql.jswith your actual OpenAI API key. - Replace
your_teams_webhook_urlinanalyze-sql.jswith your actual Microsoft Teams webhook URL.
- Place your SQL migration files in the
scriptsdirectory. - Run the script:
node analyze-sql.js
- The script reads all SQL files from the
scriptsdirectory. - For each file, it reads the content and sends it to OpenAI's GPT-4 model for analysis.
- The analysis result is logged to the console.
- Optionally, the analysis can be sent to a Microsoft Teams channel using a webhook.
SQL-Analyzer/ ├── analyze-sql.js ├── README.md └── scripts/ ├── 20241125_1820_ALTER_TABLE_Laskurivi_ADD_SubType.sql ├── 20241125_1820_ALTER_TABLE_MaksusuunnitelmaEraRivi_ADD_SubType.sql └── 20241126_1600_UPDATE_TuoteArvoLaji.sql
This project is licensed under the MIT License. See the LICENSE file for details.