Comments (2)
Prisma是一个ORM库,用于实现SQL语句的封装。
需要后端针对每个需求都写封装SQL语句的代码哦
https://github.com/prismagraphql/prisma/blob/master/examples/application-server/generated-schema.graphql
查询:
type Query {
posts(where: PostWhereInput, orderBy: PostOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Post]!
users(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [User]!
post(where: PostWhereUniqueInput!): Post
user(where: UserWhereUniqueInput!): User
postsConnection(where: PostWhereInput, orderBy: PostOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): PostConnection!
usersConnection(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): UserConnection!
"""Fetches an object given its ID"""
node(
"""The ID of an object"""
id: ID!
): Node
}
增删改:
type Mutation {
createPost(data: PostCreateInput!): Post!
createUser(data: UserCreateInput!): User!
updatePost(data: PostUpdateInput!, where: PostWhereUniqueInput!): Post
updateUser(data: UserUpdateInput!, where: UserWhereUniqueInput!): User
deletePost(where: PostWhereUniqueInput!): Post
deleteUser(where: UserWhereUniqueInput!): User
upsertPost(where: PostWhereUniqueInput!, create: PostCreateInput!, update: PostUpdateInput!): Post!
upsertUser(where: UserWhereUniqueInput!, create: UserCreateInput!, update: UserUpdateInput!): User!
updateManyPosts(data: PostUpdateInput!, where: PostWhereInput): BatchPayload!
updateManyUsers(data: UserUpdateInput!, where: UserWhereInput): BatchPayload!
deleteManyPosts(where: PostWhereInput): BatchPayload!
deleteManyUsers(where: UserWhereInput): BatchPayload!
}
更新:
以上链接已失效,官方迁移了 examples,可以参考
https://github.com/prisma/prisma-examples/blob/master/node/docker-mysql/src/script.js
https://github.com/prisma/prisma-examples/blob/master/node/docker-mysql/src/generated/prisma-client/prisma-schema.js
而APIJSON是完全自动化生成SQL语句的,后端不需要写相关代码。
前端按照 设计规范 来请求,后端会完全自动解析成SQL语句去连接数据库执行,并返回和Request JSON结构完全对应的Response JSON
这是APISJONAuto接口在线工具,文档上给出的表和字段随便试,任何结构任何数据都支持。
http://apijson.org/auto
from apijson.
@zwl1619 APIJSON Node 版本也出来了,语言一样,你可以具体对比下。
目前在初期阶段,用了 TypeORM,所以需要写 Model 类(Java 版不需要)。
apijson-node 支持单表、关联、数组、分页查询等,有比较完善的文档,
我测试过,除了项目提供的表有 utf8 编码问题导入不了 (用我自己的表测试可以),其它都可用。
作者是微医的,已经写了不少测试用例,在他公司内部用起来了。
点 Star 鼓励作者继续完善吧 ^_^
https://github.com/kevinaskin/apijson-node
from apijson.
Related Issues (20)
- 希望对apijson事务有一个系统的介绍 HOT 2
- 【Lenovo 联想】【500 强】全球最大电脑厂商联想内网链接了 APIJSON
- [SHEIN] The intranet of China's biggest cross-border e-commerce company SHEIN linked APIJSON and apijson-framework
- [Lenovo][Fortune 500] The intranet of the biggest PC company Lenovo linked APIJSON
- 【Xiaomi 小米】【500 强】内网部署的飞书内部文档链接了 APIJSON-Demo
- [Xiaomi][Fortune 500] Linked APIJSON-Demo in its official Lark(by ByteDance) website
- [CHINA TELECOM][Fortune 500] China's biggest network provider CHINA TELECOM applied an OpenAPI patent for a low-code platform using APIJSON
- 两张表进行内链查询时,第二张表查询生成的库为默认sys HOT 7
- [Bug]字符 getMethodDefination(method,arguments,type,exceptions,language) 对应的远程函数 getMethodDefination(JSONObject request, String method, String arguments, String type, String exceptions, String language) 不在后端 apijson.demo.DemoFunctionParser 内,也不在父类中!如果需要则先新增对应方法! 请检查函数名和参数数量是否与已定义的函数一致! HOT 1
- [ORACLE] 子查询内部默认添加分页语句,导致in函数无法实现,提示Error Msg = ORA-00913: 值过多的报错 HOT 2
- 【AtlasMap】官网链接了 apijson-column
- [AtlasMap] official website linked apijson-column
- 文档醒目位置没有Getting started,没有说明如何运行这个项目 HOT 1
- [Bug] 达梦数据库做表左关联时提示有歧义的列名[RN] HOT 2
- 【Alibaba 阿里巴巴】【淘天集团】淘宝内网文档链接了 APIJSON
- [Alibaba][Fortune 500] taobao.com internal doc site linked APIJSON
- 希望新增“导出查询结果到excel”的功能 HOT 1
- 查询库表字段信息 HOT 2
- 请求信息中日期/时间的处理方法 HOT 1
- [Bug] 扩展@combine,同一个key在筛选/数据体中可同时存在,两者非互斥逻辑 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apijson.