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

eagle-breeze

v0.1.0

Published

## 备注

Downloads

3

Readme

MySQL Breeze

备注

  • mysql 关键字: '$maxvalue', or '$minvalue'

函数说明

table(tableName, fields[, options])

创建表

参数

  • tableName (string):表名
  • fields (BreezeFields): 字段描述
  • options (Options): 配置参数

返回值

(Table) :表对象

例子

(async () => {
  const table = await breeze.table('your_table_name', {
    a: 'INT',
    b: { type: 'VARCHAR(14)'}
  })
  cosnt doc = await table.find({
    condition: {
      a: {
        $gte: 10
      },
      b: 'foo'
    }
  })
})()

partition(table, key, content[, options])

创建表分区

参数

  • table (breeze.Table): 表对象
  • key (string|string[]): 分区字段
  • content (*): 分区内容 *

BreezeFields

type

MYSQL的字段类型,例如:

{
  name: {type: 'VARCHAR(10)'},
  age: 'INT',
  birthday: 'DATETIME'
}

default

默认值, autoIncrement=true 时 default 无效

{
  name: {type: 'VARCHAR(10)'},
  age: 'INT',
  birthday: { 
    type: 'DATETIME',
    default: '2000-01-01 00:00:00',
  }
}

notNull

是否不能为NULL, 默认false

{
  name: {
    type: 'VARCHAR(10)',
    notNull: true
  },
  age: 'INT',
  birthday: { 
    type: 'DATETIME',
    default: '2000-01-01 00:00:00',
  }
}

unique

是否唯一, 默认false

{
  ID: {
    type: 'varchar(18)',
    unique: true
  }
  name: {
    type: 'VARCHAR(10)',
    notNull: true
  },
  age: 'INT',
  birthday: { 
    type: 'DATETIME',
    default: '2000-01-01 00:00:00',
  }
}

primaryKey

主键, 默认false

{
  id: {
    type: 'INT',
    primaryKey: true,
    autoIncrement: true
  }
  name: {
    type: 'VARCHAR(10)',
    notNull: true
  },
  age: 'INT',
  birthday: { 
    type: 'DATETIME',
    default: '2000-01-01 00:00:00',
  }
}

Options

database

指定数据库, 默认为连接MySQL时指定的数据库

{
  database: 'fy4b'
}

engine

指定存储引擎选项, 默认为数据库的默认存储引擎

{
  engine: 'MyISAM' // 'InnoDB' or 'MEMORY' or 'ARCHIVE' ...
}

charset

指定表的默认字符集, 如果没有显式指定字符集,默认情况下会使用数据库的默认字符集

{
  charset: 'utf8mb3' // 'utf8mb4'
}

rowFormat

指定表的行格式, 5.7版本后默认情况下将使用DYNAMIC行格式

{
  rowFormat: 'DYNAMIC'
}

DYNAMIC 种动态行格式,它根据行的实际需要来灵活地存储数据,以节省磁盘空间

autoIncrement

指定该表的自增列的起始值, 默认0

{
  autoIncrement: 10
}

Table