protoc-gen-map:grpcprotobufSQL数据映射器框架-源码

上传者: 42146230 | 上传时间: 2021-01-30 23:03:58 | 文件大小: 136KB | 文件类型: ZIP
原始图 警告:该项目不再维护。 对于SQL数据映射,请使用 。 protoc-gen-map通过将SQL数据映射到协议缓冲区来简化复杂数据集的管理。 除了定义原型消息和SQL语句外,开发人员无需编写任何数据检索或映射代码。 方法 protoc-gen-map采用“数据库映射”方法(在Martin Fowler的描述),在具有严格代码审查流程和专门的数据库建模人员团队的组织中非常有用。 protoc-gen-map与语言无关。 任何支持协议缓冲区的语言都可以使用已定义的消息通过gRPC请求和检索数据。 该框架不是对象关系映射器(ORM)。 对于大型和复杂的数据集,在处理复杂查询时,使用ORM会受到限制并降低性能。 SQL模板 protoc-gen-map使用golang的模板引擎(文本/模板)。 这使开发人员可以根据gRPC请求消息动态修改sql参数,使用if语句或for循环,以及将大型SQL语句拆分为多个逻辑块。 下面的示例中有更多内容。 范例与指南 简单的例子 让我们使用一个非常简单的模式 假设我们要根据某些请求检索博客信息。 为此,我们可以如下创建gRPC服务和SQL模板

文件下载

资源详情

[{"title":"( 74 个子文件 136KB ) protoc-gen-map:grpcprotobufSQL数据映射器框架-源码","children":[{"title":"protoc-gen-map-master","children":[{"title":"go.mod <span style='color:#111;'> 1.31KB </span>","children":null,"spread":false},{"title":"main.go <span style='color:#111;'> 265B </span>","children":null,"spread":false},{"title":".github","children":[{"title":"stale.yaml <span style='color:#111;'> 696B </span>","children":null,"spread":false}],"spread":true},{"title":"testdata","children":[{"title":"sql","children":[{"title":"reflect.sql <span style='color:#111;'> 1.06KB </span>","children":null,"spread":false},{"title":"mapping.sql <span style='color:#111;'> 4.72KB </span>","children":null,"spread":false}],"spread":true},{"title":"testdata.go <span style='color:#111;'> 4.57KB </span>","children":null,"spread":false},{"title":"mapper.golden <span style='color:#111;'> 78.54KB </span>","children":null,"spread":false},{"title":"tests.pb.map.go <span style='color:#111;'> 140.94KB </span>","children":null,"spread":false},{"title":"callbacks.go <span style='color:#111;'> 2.37KB </span>","children":null,"spread":false},{"title":"initdb","children":[{"title":"sql","children":[{"title":"init_db.sql <span style='color:#111;'> 1.03KB </span>","children":null,"spread":false},{"title":"inserts.sql <span style='color:#111;'> 928B </span>","children":null,"spread":false}],"spread":true},{"title":"initdb.proto <span style='color:#111;'> 1.39KB </span>","children":null,"spread":false},{"title":"initdb.pb.go <span style='color:#111;'> 38.89KB </span>","children":null,"spread":false},{"title":"BUILD <span style='color:#111;'> 1.14KB </span>","children":null,"spread":false},{"title":"initdb.pb.map.go <span style='color:#111;'> 23.07KB </span>","children":null,"spread":false}],"spread":true},{"title":"gentest","children":[{"title":"sql","children":[{"title":"sql","children":[{"title":"subdir.sql <span style='color:#111;'> 42B </span>","children":null,"spread":false}],"spread":true},{"title":"gentest.sql <span style='color:#111;'> 494B </span>","children":null,"spread":false}],"spread":true},{"title":"unary_type_test.proto <span style='color:#111;'> 837B </span>","children":null,"spread":false},{"title":"only_unary_exec.pb.map.go <span style='color:#111;'> 3.53KB </span>","children":null,"spread":false},{"title":"unary_type_test.pb.go <span style='color:#111;'> 31.90KB </span>","children":null,"spread":false},{"title":"only_unary_query.pb.map.go <span style='color:#111;'> 4.46KB </span>","children":null,"spread":false},{"title":"only_unary_query.proto <span style='color:#111;'> 214B </span>","children":null,"spread":false},{"title":"only_unary_exec.pb.go <span style='color:#111;'> 8.31KB </span>","children":null,"spread":false},{"title":"only_unary_exec.proto <span style='color:#111;'> 213B </span>","children":null,"spread":false},{"title":"unary_type_test.pb.map.go <span style='color:#111;'> 25.83KB </span>","children":null,"spread":false},{"title":"only_streaming.pb.map.go <span style='color:#111;'> 5.55KB </span>","children":null,"spread":false},{"title":"only_streaming.proto <span style='color:#111;'> 241B </span>","children":null,"spread":false},{"title":"only_unary_query.pb.go <span style='color:#111;'> 8.32KB </span>","children":null,"spread":false},{"title":"only_streaming.pb.go <span style='color:#111;'> 9.19KB </span>","children":null,"spread":false},{"title":"BUILD <span style='color:#111;'> 1.29KB </span>","children":null,"spread":false}],"spread":false},{"title":"tests.pb.go <span style='color:#111;'> 134.13KB </span>","children":null,"spread":false},{"title":"BUILD <span style='color:#111;'> 1.63KB </span>","children":null,"spread":false},{"title":"tests.proto <span style='color:#111;'> 5.26KB </span>","children":null,"spread":false}],"spread":true},{"title":"go.sum <span style='color:#111;'> 17.54KB </span>","children":null,"spread":false},{"title":"bazel","children":[{"title":"http_dependencies.bzl <span style='color:#111;'> 3.28KB </span>","children":null,"spread":false},{"title":"go_repositories.bzl <span style='color:#111;'> 13.27KB </span>","children":null,"spread":false},{"title":"imports.bzl <span style='color:#111;'> 340B </span>","children":null,"spread":false},{"title":"BUILD <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true},{"title":"mapper","children":[{"title":"param.go <span style='color:#111;'> 2.63KB </span>","children":null,"spread":false},{"title":"reflect_test.go <span style='color:#111;'> 754B </span>","children":null,"spread":false},{"title":"mapper.go <span style='color:#111;'> 18.16KB </span>","children":null,"spread":false},{"title":"mapper_test.go <span style='color:#111;'> 13.98KB </span>","children":null,"spread":false},{"title":"BUILD <span style='color:#111;'> 1.35KB </span>","children":null,"spread":false},{"title":"param_test.go <span style='color:#111;'> 2.02KB </span>","children":null,"spread":false},{"title":"reflect.go <span style='color:#111;'> 5.72KB </span>","children":null,"spread":false}],"spread":true},{"title":"plugin","children":[{"title":"plugin.go <span style='color:#111;'> 1.20KB </span>","children":null,"spread":false},{"title":"generate_test.go <span style='color:#111;'> 462B </span>","children":null,"spread":false},{"title":"templates.go <span style='color:#111;'> 3.37KB </span>","children":null,"spread":false},{"title":"generate.go <span style='color:#111;'> 7.13KB </span>","children":null,"spread":false},{"title":"BUILD <span style='color:#111;'> 1014B </span>","children":null,"spread":false},{"title":"imports.go <span style='color:#111;'> 1.30KB </span>","children":null,"spread":false}],"spread":true},{"title":"examples","children":[{"title":"sql","children":[{"title":"query.sql <span style='color:#111;'> 2.32KB </span>","children":null,"spread":false}],"spread":true},{"title":"server.go <span style='color:#111;'> 1009B </span>","children":null,"spread":false},{"title":"query.pb.map.go <span style='color:#111;'> 23.17KB </span>","children":null,"spread":false},{"title":"generate.sh <span style='color:#111;'> 166B </span>","children":null,"spread":false},{"title":"BUILD <span style='color:#111;'> 1.22KB </span>","children":null,"spread":false},{"title":"query.proto <span style='color:#111;'> 1.85KB </span>","children":null,"spread":false},{"title":"query.pb.go <span style='color:#111;'> 48.89KB </span>","children":null,"spread":false}],"spread":true},{"title":"CONTRIBUTING.md <span style='color:#111;'> 1.42KB </span>","children":null,"spread":false},{"title":"LICENSE <span style='color:#111;'> 11.09KB </span>","children":null,"spread":false},{"title":"WORKSPACE <span style='color:#111;'> 300B </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 18.90KB </span>","children":null,"spread":false},{"title":"Makefile <span style='color:#111;'> 859B </span>","children":null,"spread":false},{"title":"BUILD <span style='color:#111;'> 814B </span>","children":null,"spread":false},{"title":"templates","children":[{"title":"streaing_response.go <span style='color:#111;'> 4.31KB </span>","children":null,"spread":false},{"title":"templates.go <span style='color:#111;'> 360B </span>","children":null,"spread":false},{"title":"unary_response.go <span style='color:#111;'> 4.85KB </span>","children":null,"spread":false},{"title":"init.go <span style='color:#111;'> 91B </span>","children":null,"spread":false},{"title":"server.go <span style='color:#111;'> 278B </span>","children":null,"spread":false},{"title":"funcs.go <span style='color:#111;'> 2.61KB </span>","children":null,"spread":false},{"title":"enum_value_maps.go <span style='color:#111;'> 295B </span>","children":null,"spread":false},{"title":"BUILD <span style='color:#111;'> 824B </span>","children":null,"spread":false},{"title":"funcs_test.go <span style='color:#111;'> 2.19KB </span>","children":null,"spread":false}],"spread":false},{"title":".gitignore <span style='color:#111;'> 208B </span>","children":null,"spread":false}],"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明