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

gg-tablestore

v1.0.9

Published

链式操作查询tablestore,详情见 [GitHub](https://github.com/1stgg/gg-tablestore)

Downloads

3

Readme

链式操作查询tablestore

示例

db('table_name')
.where({
	int : ['>=',666],
	str : 'str',
	and:[//多条件
		{
			bool:false,
			not:[
				{bool:true,int:['in',[600,500]],}
			]
		},
		{
			int:['<=',600],
			str_data:['like','*E*'],
			or:[
				{bool:true,str_data:'TEXT'},
				{bool:false},
			]
		}
	]
})
.r()

注意事项

  • 目前在初始开发中,不保证向上兼容
  • npm安装的可能是旧版,可能与文档不符
  • git下载,不保证是stable版
  • 高效是指开发高效,并非运行高效

使用方式

1.安装

npm i gg-tablestore --s

2.配置

let gdb = require('gg-tablestore')
global.db = gdb({
	accessKeyId: 'accessKeyId',
	secretAccessKey: 'secretAccessKey',
	endpoint: 'endpoint',
	instancename: 'instancename',
})
//建议使用以下配置
db().setDefault({
	delete:{
		type:10,//0:真删除,10:假删除,允许config()设置,20:所有数据都假删除,config()设置无效
		dustbin_type:10,//0:删除的数据 不 添加到垃圾箱,10:真删除的数据 添加到垃圾箱,20:真假 删除的都数据 都添加到垃圾箱
	},
	data:{
		type:'simple',//origin:原本返回什么就是什么,simple:简化版
	},
	index:{//索引,关联函数 table.js createTable()
		type:'time_random',//custom:自定义,time_random:索引只有id,值为  时间戳+随机数
	}
})

2.1默认设置值为

{
	limit:10,//查询默认条数
	count:false,//是否返回总条数
	delete:{
		type:0,//0:真删除,10:假删除,允许config()设置,20:所有数据都假删除,config()设置无效
		filed:'_del',//假删除字段,true表示已删除
		dustbin_type:0,//0:删除的数据 不 添加到垃圾箱,10:真删除的数据 添加到垃圾箱,20:真假 删除的都数据 都添加到垃圾箱
		dustbin_table_name:'gg_dustbin',//垃圾箱 表名
	},
	data:{
		type:'origin',//origin:原本返回什么就是什么,simple:简化版
	},
	index:{//索引
		type:'custom',//custom:自定义,time_random:索引只有id,值为  时间戳+随机数
	}
}

3.使用

4.where支持类型

|name|title|示例| |-|-|-| |默认|等于|int:233| |>,>=,<,<=|比较|int:['>',233]| |in|包含|int:['in',[233,666]]| |like|通配符模糊搜索|str:['like','*val*']]|

使用方式

//u方法
let up_status = await db(db_name).where({
	a:['>',233],
}).u({
	a:666
})
//r()和d()如上

5.config字段

|name|title|示例| |-|-|-| |del|是否真删除|true:真删除| |count|是否返回总计条数|true:返回| |page|列表返回第几页,翻页建议使用next()|int类型| |next|r() 返回的next|str类型| |limit|每页返回几行数据|int类型| |sort|排序|{a:'asc',latlng:['geo',['25.002,120.001'],'desc']}| |column|返回哪些字段|'a,latlng'|