{"id":15287417,"url":"https://github.com/olimsaidov/yesql-bundle","last_synced_at":"2025-09-04T02:37:30.493Z","repository":{"id":57030984,"uuid":"57024069","full_name":"olimsaidov/yesql-bundle","owner":"olimsaidov","description":"Yesql Bundle","archived":false,"fork":false,"pushed_at":"2018-01-16T11:01:05.000Z","size":13,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-20T08:16:38.083Z","etag":null,"topics":["doctrine","sql","symfony-bundle","yesql"],"latest_commit_sha":null,"homepage":null,"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/olimsaidov.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}},"created_at":"2016-04-25T08:17:59.000Z","updated_at":"2018-01-20T20:02:43.000Z","dependencies_parsed_at":"2022-08-23T18:50:42.404Z","dependency_job_id":null,"html_url":"https://github.com/olimsaidov/yesql-bundle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/olimsaidov/yesql-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olimsaidov%2Fyesql-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olimsaidov%2Fyesql-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olimsaidov%2Fyesql-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olimsaidov%2Fyesql-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olimsaidov","download_url":"https://codeload.github.com/olimsaidov/yesql-bundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olimsaidov%2Fyesql-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273542683,"owners_count":25124207,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["doctrine","sql","symfony-bundle","yesql"],"created_at":"2024-09-30T15:28:06.112Z","updated_at":"2025-09-04T02:37:30.466Z","avatar_url":"https://github.com/olimsaidov.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Installation\n============\n\nStep 1: Download the Bundle\n---------------------------\n\nOpen a command console, enter your project directory and execute the\nfollowing command to download the latest stable version of this bundle:\n\n```bash\n$ composer require olimsaidov/yesql-bundle\n```\n\nThis command requires you to have Composer installed globally, as explained\nin the [installation chapter](https://getcomposer.org/doc/00-intro.md)\nof the Composer documentation.\n\nStep 2: Enable the Bundle\n-------------------------\n\nThen, enable the bundle by adding it to the list of registered bundles\nin the `app/AppKernel.php` file of your project:\n\n```php\n\u003c?php\n// app/AppKernel.php\n\n// ...\nclass AppKernel extends Kernel\n{\n    public function registerBundles()\n    {\n        $bundles = array(\n            // ...\n\n            new Ox\\YesqlBundle\\YesqlBundle(),\n        );\n\n        // ...\n    }\n\n    // ...\n}\n```\n\nStep 3: Configure the Bundle\n-------------------------\n\nThen, configure the bundle by adding the following lines\nin the `app/config/config.yml` file of your project:\n\n```yaml\nyesql:\n  connection: default # optional, doctrine custom connection name\n  services:\n    -\n      path: \"%kernel.root_dir%/../src/Acme/BlogBundle/Resources/blog.sql\" # path to sql file\n      name: \"blog\" # service name\n```\n\nEach query in your SQL file must be commented like this:\n\n```sql\n-- name: getAllPosts*\n-- This will fetch all rows from posts\nselect * from posts;\n\n-- name: getPostById\n--\nselect * from posts where id = ?;\n\n-- name: insertPost\n-- You can use parametrized placeholder\ninsert into post (title, body) values (:title, :body);\n```\n\nQuery name must end with ```*``` symbol to query multiple rows.\n\nStep 4: Use the Bundle\n-------------------------\n\nExecute your queries by calling the service:\n\n```php\n$this-\u003eget('yesql.blog')-\u003egetAllPosts(); // returns all posts as array\n\n$this-\u003eget('yesql.blog')-\u003egetPostById(3); // returns single post\n\n$this-\u003eget('yesql.blog')-\u003einsertPost([':title' =\u003e 'Hello', ':body' =\u003e 'World']); // returns last insert id\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folimsaidov%2Fyesql-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folimsaidov%2Fyesql-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folimsaidov%2Fyesql-bundle/lists"}