{"id":23885757,"url":"https://github.com/null511/dapper.scripts","last_synced_at":"2025-04-10T01:23:30.367Z","repository":{"id":144190366,"uuid":"102662991","full_name":"null511/Dapper.Scripts","owner":"null511","description":"Extension of Dapper which supports binding a sql-script collection to a sql-connection.","archived":false,"fork":false,"pushed_at":"2024-03-02T22:11:21.000Z","size":1478,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T03:04:59.688Z","etag":null,"topics":["dapper","external","script","sql"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/null511.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}},"created_at":"2017-09-06T22:08:38.000Z","updated_at":"2023-11-14T00:53:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"3c077a3c-1439-4e8c-a011-68564fe08914","html_url":"https://github.com/null511/Dapper.Scripts","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/null511%2FDapper.Scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/null511%2FDapper.Scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/null511%2FDapper.Scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/null511%2FDapper.Scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/null511","download_url":"https://codeload.github.com/null511/Dapper.Scripts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248138649,"owners_count":21053913,"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":["dapper","external","script","sql"],"created_at":"2025-01-04T05:53:43.754Z","updated_at":"2025-04-10T01:23:30.341Z","avatar_url":"https://github.com/null511.png","language":"C#","readme":"# Dapper Scripts\nExtension of Dapper which supports binding a collection of SQL scripts to a `SqlConnection`.\n\nAvoid embedding SQL text strings into your code, and leverage syntax hightlighting, by storing your SQL operations in external *.sql files. Dapper scripts binds a collection of key-based sql strings to a connection factory, allowing you to keep your database code clean. All extensions match the original dapper commands, but using a _*Script_ suffix.\n\n**Setup**\n```c#\nstatic class Sql\n{\n    public static SqlScriptConnectionFactory SampleDatabase {get;}\n    \n    static Sql()\n    {\n        var scripts = new SqlScriptCollection();\n        scripts.Add.FromFile(\"test-query\", \"query.sql\");\n\n        DatabaseName = new SqlScriptConnectionFactory(scripts);\n        DatabaseName.ConnectionString = \"Server: ...;\";\n    }\n}\n```\n\n_Note:_ For best results, it is recommended to use _Embedded Content_ as the Content Type for your sql files. This will allow them to be stored within your assembly file after compiling.\n\n**Usage**\n```c#\nusing (var connection = Sql.SampleDatabase.Connect()) {\n    return connection.QueryScript(\"test-query\", new {arg = value});\n}\n```\n\nFor more examples, visit the [WiKi](https://github.com/null511/Dapper.Scripts/wiki).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnull511%2Fdapper.scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnull511%2Fdapper.scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnull511%2Fdapper.scripts/lists"}