npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cqio

v1.0.0

Published

允许客户端直接操控数据库,适用于服务端弱业务逻辑的通用CRUD操作

Downloads

5

Readme

qio

在服务端AIP开发过程中,经常需要向客户端提供一些纯数据库操作的简单CRUD接口,这些接口的共同特征是除访问权限外的其它业务逻辑几乎是相同的。为了避免编写重复的接口代码,减少服务端接口数量,我们在抽象接口的基础上加入权限控制,实现对更多应用场景的适配。

qio原理

qio模块由模型映射和权限管理两部分构成。首先解析来自客户端的query请求,将请求映射为与sequelize相对应的模型操作表达式,实现客户端直接读写数据库。当然我们肯定不希望有人随意操作我们的数据库,如读写某些敏感的数据表或字段。因此必须引入权限管理来约束使用者的行为。

与Graphql的异同

Graphql的官方定义是“一种用于API的查询语言”,它和SQL语言思想类似,通过制定统一的查询规范,并使用字符串作为查询语言,实现跨语言通用特性。

相比Graphql的跨平台特性,qio只专注于Node.js平台实现,我们希望以更加直观、易用、轻量的方式直接在客户端操作数据库。

如果你有使用firebase、leancloud、野狗这类BaaS服务,他们接口是类似的,但是qio允许你自由的选择数据库和架构,摆脱平台限制。