react sql格式化_前端SQL-React,Postgres和RLS /第1部分

本文探讨了如何在前端使用React进行SQL格式化,参考了一篇介绍结合Postgres和RLS(Row Level Security)实现的实战经验。
摘要由CSDN通过智能技术生成

react sql格式化

When it comes to the data exchange between the frontend and the backend REST is the most common way to go. At least it was until GraphQL came in. When I heard the first time about GraphQL I though that was it. One endpoint and declarative way of getting backend data was a promise of faster and easier development process. It seemed that I didn’t need to disturb backend devs anymore and that getting the data is fully in my control.

当涉及到前端和后端REST之间的数据交换时,这是最常见的方法。 至少直到GraphQL出现为止。当我第一次听说GraphQL时,就是这样。 一种获取后端数据的端点和声明方式是对更快,更轻松的开发过程的承诺。 似乎我不再需要打扰后端开发人员,并且完全由我控制数据的获取。

But once I dived in a little bit there where few things that drawn me away:

但是,一旦我潜入一点,那里几乎没有什么吸引我的:

  1. Another query language

    另一查询语言
  2. JSON like query language (not very readable)

    类似于查询语言的JSON(不太可读)
  3. Complex mutations

    复杂突变
  4. Efficient queries need good and intricate resolvers to be written

    高效的查询需要编写出色而复杂的解析器

So yes, I didn’t write any serious app with GraphQL, but still, I think that being independent from the backend would be a huge benefit. And if I didn’t need to modify the backend code related to exposing frontend data each time the shape of that data changes or new data is added it would be a big relief.

因此,是的,我没有使用GraphQL编写任何严肃的应用程序,但我仍然认为,独立于后端将是巨大的好处。 而且,如果我不需要每次更改数据的形状或添加新数据时都需要修改与公开前端数据有关的后端代码,那将是一件很大的事情。

Of course GraphQL has its place and will help you especially if your app is one of those bigger ones and if it combines multiple data sources but for my side projects there must be something simpler but with similar advantages.

当然,GraphQL占有一席之地,它将为您提供帮助,特别是如果您的应用是其中的一个较大应用,并且如果它结合了多个数据源,但是对于我的副项目,则必须有一些更简单但具有类似优势的东西。

My typical side project looks like this:

我典型的辅助项目如下所示:

  • there is a backend server (currently Kotlin + Spring / Micronaut)

    有一个后端服务器(目前是Kotlin + Spring / Micronaut)
  • backend is connected to the Postgres database

    后端连接到Postgres数据库
  • backend is divided into querying and writing parts (simple form of CQS)

    后端分为查询和编写部分( CQS的简单形式)

  • backend uses REST to communicate

    后端使用REST进行通信
  • frontend is in most cases built with React and Typescript and Axios +

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值