{"id":44610377,"url":"https://github.com/neeker/sqlrestful","last_synced_at":"2026-02-26T22:01:12.516Z","repository":{"id":45475009,"uuid":"182836924","full_name":"neeker/sqlrestful","owner":"neeker","description":"Use SQL \u0026 Javascript to develop MicroServices of CloudNative","archived":false,"fork":false,"pushed_at":"2021-12-12T08:28:43.000Z","size":12611,"stargazers_count":15,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T00:11:33.236Z","etag":null,"topics":["baas","cloudnative","docker","go","golang","mysql","oracle","postgres","restful","restful-api"],"latest_commit_sha":null,"homepage":"https://neeker.github.io/sqlrestful","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/neeker.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":"2019-04-22T17:38:53.000Z","updated_at":"2023-11-23T00:55:41.000Z","dependencies_parsed_at":"2022-07-16T14:30:41.529Z","dependency_job_id":null,"html_url":"https://github.com/neeker/sqlrestful","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/neeker/sqlrestful","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neeker%2Fsqlrestful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neeker%2Fsqlrestful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neeker%2Fsqlrestful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neeker%2Fsqlrestful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neeker","download_url":"https://codeload.github.com/neeker/sqlrestful/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neeker%2Fsqlrestful/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29874452,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T21:05:00.265Z","status":"ssl_error","status_checked_at":"2026-02-26T20:57:13.669Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["baas","cloudnative","docker","go","golang","mysql","oracle","postgres","restful","restful-api"],"created_at":"2026-02-14T12:00:22.733Z","updated_at":"2026-02-26T22:01:12.474Z","avatar_url":"https://github.com/neeker.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# SQL转Restful微服务接口开发工具\n\n## 设计初衷\n\n一直在使用`Java+SpringBoot`作为微服务生产力工具，通常来讲实现一个Restful微服务接口需要做以下相关工作：\n\n  - ORM映射实现：通常使用MyBatis，需要写Pojo类、Mapper类和SQLProvider类。\n  - 服务层实现：需要一个对象管理接口类与一个对象管理实现类。\n  - 控制层实现：一个RestConfoller类并注解Rest方法再调用服务层实现。\n  - Devops配置：Dockerfile、k8s部署描述文件等等。\n\n这样一个`Restful`接口实现下来至少需要`5`个以上的类，大部分工作是在做转换、校验等语言相关的工作。\n\n我们可以想想从SQL到Restful经历了多少层的实现，而大部分工作是毫无意义的规则代码。。。\n\n\u003e 您可能会建议我使用spring-cloud云原生开发框架，但一样也少不上述过程。\n\n因此一直以来，我一直想要有一个工具可以直接把SQL转成Restful微服务接口，同时它必须是云原生的开发方式：\n\n  - 1、配置化实现：通过简单的配置边可以很方便的实现SQL转Restful接口；\n  - 2、执行效率高：不能因为配置和转换减低运行效率；\n  - 3、可容器化部署：能方便打包成Docker镜像并运行；\n  - 4、多数据库支持：包括oracle、db2、mysql、postgres、hadoop等。\n\n通过此工具可以快速对外提供Restful规范的数据微服务接口，满足碎片化的数据服务需求应用场景的快速响应。\n\n说干就干，于是我找到了[sqler](https://github.com/alash3al/sqler)，但是[sqler](https://github.com/alash3al/sqler)仅支持REST而不支持完整的Restful规范。\n\n因此我在其基础之上实现了一个完整的SQL转Restful接口的服务工具，兼容[sqler](https://github.com/alash3al/sqler)配置语法的同时进行了Restful配置扩展实现。\n\n感谢开源！\n\n## 特色功能\n\n - [x] 使用`SQL`及`Javascript`实现完整的Restful微服务接口\n - [x] 内置`Swagger`接口文档界面（`Swagger2.0`支持）\n - [x] 为Restful微服务接口提供内置的`Redis`缓存配置。\n - [x] 配置脚本支持完整的`Javascript ECMAScript 5.1`规范\n - [x] 动态查询实现提供器支持不同参数的SQL实现分支\n - [x] 提供oci驱动支持Oracle数据库（参见【[数据库支持列表](docs/db.md)】）\n - [x] 消息接收与发送支持，包括stomp、amqp、kafka等协议\n - [x] 支持静态文件目录与静态文件独立映射\n - [x] 支持websocket消息服务定义实现\n - [x] 支持反向代理其他后台接口服务\n\n## 快速入门\n\n - [`SQLRestful`开发入门示例](docs/start.md)\n - [`SQLRestful`开发及配置说明](docs/macros.md)\n - [`HCL`配置语言快速入门](docs/hcl.md)\n\n## 开箱示例\n\n```sh\ndocker run -ti --rm -p 80:80 snz1/sqlrestful \\\n  --name sqlrestful \\\n  -driver \"sqlite3\" \\\n  -dsn \"/tmp/tmp.db?create=true\" \\\n  -debug 3 \\\n  -swagger \\\n  -config \"/examples/sqlite.hcl\"\n```\n\n\u003e 此时打开\u003chttp://127.0.0.1/doc.html\u003e查看示例实现接口文档。\n\n## 示例截图\n\n\u003cdiv text-align=\"center\"\u003e\n\n\u003ch3\u003e开箱即用的容器环境：\u003ch3\u003e\n\n\u003cimg src=\"docs/img/run.png\" width=\"80%\" \u003e \u003cbr\u003e\n\n\u003ch3\u003e查看接口文档：\u003ch3\u003e\n\n\u003cimg src=\"docs/img/swagger.png\" width=\"80%\" \u003e \u003cbr\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneeker%2Fsqlrestful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneeker%2Fsqlrestful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneeker%2Fsqlrestful/lists"}