{"id":22927071,"url":"https://github.com/inkflow59/sqlgenix","last_synced_at":"2026-02-19T06:30:58.862Z","repository":{"id":267976483,"uuid":"902928669","full_name":"Inkflow59/SQLGenix","owner":"Inkflow59","description":"A PHP library that let you build easily your SQL queries to build your dynamics websites easier, enabling performance and efficiency for your interactions with your databases","archived":false,"fork":false,"pushed_at":"2025-02-19T19:37:58.000Z","size":1385,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T23:11:17.449Z","etag":null,"topics":["composer","php-library","php8","sql"],"latest_commit_sha":null,"homepage":"https://sqlgenix.vercel.app","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Inkflow59.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-13T15:01:58.000Z","updated_at":"2025-02-28T11:27:11.000Z","dependencies_parsed_at":"2025-02-17T20:39:00.654Z","dependency_job_id":null,"html_url":"https://github.com/Inkflow59/SQLGenix","commit_stats":null,"previous_names":["inkflow59/sqlflow"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inkflow59%2FSQLGenix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inkflow59%2FSQLGenix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inkflow59%2FSQLGenix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inkflow59%2FSQLGenix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Inkflow59","download_url":"https://codeload.github.com/Inkflow59/SQLGenix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249122598,"owners_count":21216350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","php-library","php8","sql"],"created_at":"2024-12-14T09:13:02.366Z","updated_at":"2026-02-19T06:30:58.844Z","avatar_url":"https://github.com/Inkflow59.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQLGenix 🚀\n\n## Supercharge Your Database Interactions\nSQLGenix is your go-to SQL query generator that takes the pain out of database operations. Say goodbye to manual SQL writing and hello to elegant, chainable methods that make database interactions a breeze. Perfect for both rapid application development and sophisticated database management tasks.\n\n## Table of Contents\n- [Key Features](#key-features)\n- [Quick Start](#quick-start)\n  - [Installation](#installation)\n  - [Usage Examples](#usage-examples)\n    - [Create New Records](#create-new-records)\n    - [Fetch Data](#fetch-data)\n    - [Update Records](#update-records)\n    - [Remove Data](#remove-data)\n- [Requirements](#requirements)\n- [Testing](#testing)\n- [Contributing](#contributing)\n- [License](#license)\n- [Get in Touch](#get-in-touch)\n\n## ✨ Key Features\n- 🎯 **Smart Query Generation** - Build complex SQL queries with simple, intuitive methods\n- 🔄 **Full CRUD Support** - Handle SELECT, INSERT, UPDATE, and DELETE operations effortlessly\n- 🔌 **Multi-Database Support** - Works seamlessly with MySQL, PostgreSQL, SQLite, and more\n- 🛡️ **Robust Error Handling** - Graceful exception management keeps your application stable\n- ⚡ **Lightning Fast** - Optimized for performance without sacrificing flexibility\n- 📄 **Pagination Support** - Built-in LIMIT, OFFSET, and page-based pagination\n- 🔄 **Query Caching** - Intelligent caching system for improved performance\n- 🔗 **UNION Operations** - Combine multiple queries with UNION and UNION ALL\n- 📦 **Bulk Operations** - Efficient batch INSERT, UPDATE, and DELETE operations\n- 🔍 **Advanced Joins** - Support for INNER, LEFT, RIGHT joins with complex conditions\n- 🏗️ **Database Adapters** - Adapter pattern for database-specific optimizations\n\n## 🚀 Quick Start\n\n### Installation\nGet started with Composer:\n```bash\ncomposer require sqlgenix/sqlgenix\n```\n\nOr clone the repository manually:\n```bash\ngit clone https://github.com/Inkflow59/SQLGenix.git\ncd SQLGenix\ncomposer install\n```\n\n### 📚 Usage Examples\n\n#### Create New Records\n```php\nrequire 'src/SQLInsert.php';\n\n$db = new Database();\n$insert = new SQLInsert($db);\n$insert-\u003einto('users')\n       -\u003eset(['name', 'email'], ['John Doe', 'john@example.com'])\n       -\u003eexecute();\n```\n\n#### Fetch Data\n```php\nrequire 'src/SQLSelect.php';\n\n$db = new Database();\n$select = new SQLSelect($db);\n$result = $select-\u003eselect(['name', 'email'])\n                 -\u003efrom('users')\n                 -\u003ewhere('email = \"john@example.com\"')\n                 -\u003eexecute();\n```\n\n#### Update Records\n```php\nrequire 'src/SQLUpdate.php';\n\n$db = new Database();\n$update = new SQLUpdate($db);\n$update-\u003etable('users')\n       -\u003eset('name', 'Jane Doe')\n       -\u003ewhere('email = \"john@example.com\"')\n       -\u003eexecute();\n```\n\n#### Remove Data\n```php\nrequire 'src/SQLDelete.php';\n\n$db = new Database();\n$delete = new SQLDelete($db);\n$delete-\u003efrom('users')\n       -\u003ewhere('email = \"john@example.com\"')\n       -\u003eexecute();\n```\n\n#### Pagination\n```php\nrequire 'src/SQLSelect.php';\n\n$db = new Database();\n$select = new SQLSelect($db);\n$result = $select-\u003eselect(['*'])\n                 -\u003efrom('users')\n                 -\u003ewhere('status = \"active\"')\n                 -\u003eorderBy(['created_at'], 'DESC')\n                 -\u003epaginate(2, 20) // Page 2, 20 per page\n                 -\u003eexecute();\n```\n\n#### Query Caching\n```php\nrequire 'src/QueryCache.php';\nrequire 'src/SQLSelect.php';\n\n$cache = new QueryCache(100, 3600); // 100 items, 1 hour TTL\n$db = new Database();\n$select = new SQLSelect($db, $cache);\n$result = $select-\u003eselect(['*'])\n                 -\u003efrom('users')\n                 -\u003ewhere('active = 1')\n                 -\u003eexecute(); // Cached automatically\n```\n\n#### UNION Operations\n```php\nrequire 'src/SQLSelect.php';\n\n$db = new Database();\n$activeUsers = new SQLSelect($db);\n$activeUsers-\u003eselect(['name', 'email'])-\u003efrom('active_users');\n\n$inactiveUsers = new SQLSelect($db);\n$inactiveUsers-\u003eselect(['name', 'email'])-\u003efrom('inactive_users');\n\n$allUsers = new SQLSelect($db);\n$result = $allUsers-\u003eselect(['name', 'email'])\n                  -\u003efrom('current_users')\n                  -\u003eunion($activeUsers)\n                  -\u003eunionAll($inactiveUsers)\n                  -\u003eexecute();\n```\n\n#### Bulk Operations\n```php\nrequire 'src/BulkOperations.php';\n\n$db = new Database();\n$bulk = new BulkOperations($db);\n\n// Bulk insert 1000 records\n$data = []; // Your data array\n$result = $bulk-\u003ebulkInsert('users', ['name', 'email'], $data);\necho \"Inserted: \" . $result['inserted_rows'] . \" rows\";\n```\n\n#### Multi-Database Support\n```php\nrequire 'src/DatabaseAdapterFactory.php';\nrequire 'src/UniversalSQLSelect.php';\n\n// Create MySQL adapter\n$mysqlAdapter = DatabaseAdapterFactory::createMySQL([\n    'host' =\u003e 'localhost',\n    'database' =\u003e 'myapp',\n    'username' =\u003e 'user',\n    'password' =\u003e 'pass'\n]);\n\n// Create PostgreSQL adapter\n$postgresAdapter = DatabaseAdapterFactory::createPostgreSQL([\n    'host' =\u003e 'localhost', \n    'database' =\u003e 'myapp',\n    'username' =\u003e 'user',\n    'password' =\u003e 'pass'\n]);\n\n// Same query works on both databases\n$mysqlQuery = new UniversalSQLSelect($mysqlAdapter);\n$postgresQuery = new UniversalSQLSelect($postgresAdapter);\n\n$result = $mysqlQuery-\u003eselect(['*'])-\u003efrom('users')-\u003eexecute();\n```\n\n## ⚙️ Requirements\n- PHP 7.0+\n- Any major SQL database (MySQL, PostgreSQL, SQLite)\n- Composer for dependency management\n\n## 🧪 Testing\nRun the test suite with:\n```bash\ncomposer test\n```\n\n## 🤝 Contributing\nWe love contributions! Here's how you can help:\n\n1. Fork the repo\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📄 License\nSQLGenix is MIT licensed. See the [LICENSE](LICENSE) file for details.\n\n## 📬 Get in Touch\nQuestions or suggestions? [Drop me a line](mailto:tomcucherosset@hotmail.fr)\n\n---\nMade with ❤️ by SQLGenix Team","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finkflow59%2Fsqlgenix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finkflow59%2Fsqlgenix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finkflow59%2Fsqlgenix/lists"}