A Single Page Application (SPA) that converts SQL queries into Sequelize queries, running entirely in the browser with a client-side database. Built with React, styled-components, and a custom SQL parser.
- Converts SQL
SELECT,INSERT,UPDATE, andDELETEqueries to Active Record and Sequelize syntax. - Supports
WHEREclauses with operators (=,!=,>,<,>=,<=) andAND/ORconditions. - Responsive UI with toggleable example queries.
Try it live at: Here
- Node.js (v20 or higher)
- npm (v9 or higher)
-
Clone the repository:
git clone https://github.com/eruity1/sql-to-orm.git cd sql-to-orm -
Install dependencies:
npm install -
Start the development server:
npm run dev
npm run build
The static assets will be generated in the build/ folder (or dist/ if using Vite).
npm test
- Enter a SQL query in the input textarea (e.g.,
SELECT * FROM users WHERE name = 'Fred'). - The app parses the query and displays the equivalent Active Record or Sequelize query.
- Toggle the "Examples" button to view sample queries.
- Results are displayed securely, with input validation to prevent malicious queries.
SELECT: Retrieve data (e.g.,SELECT name, age FROM users WHERE age >= 18)INSERT: Add data (e.g.,INSERT INTO users (name, age) VALUES ('Alice', 30))UPDATE: Modify data (e.g.,UPDATE users SET name = 'Bob' WHERE id = 1)DELETE: Remove data (e.g.,DELETE FROM users WHERE age < 18)
Contributions welcome! Please follow these steps:
-
Fork the Repository:
- Click "Fork" on the repository page to create your own copy.
-
Create a Branch:
git checkout -b your-feature-name -
Make Changes:
- Add tests for new features or bug fixes.
- Ensure all tests pass (
npm test).
-
Commit Changes:
git commit -m "Add your-feature-name" -
Push to Your Fork:
git push origin your-feature-name -
Open a Pull Request:
- Go to the original repository and create a pull request from your branch.
- Provide a clear description of your changes and reference any related issues.
- Follow React best practices (e.g., functional components, hooks).
- Avoid introducing dependencies that could affect client-side performance.
Found a bug or have a feature request? Open an issue on the [Issues page]https://github.com/eruity1/sql-to-orm/issues).
This project is licensed under the MIT License. See the LICENSE file for details.
- Built with React, styled-components, and lucide-react.
- Deployed on Netlify.