1.1.0 • Published 11 months ago

@dlovely/mysql v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

mysql-manager

目录

  • 快速入门
  • 客户端
  • 数据库
  • 数据表
  • 数据表操作
    • 联表

快速入门

安装

# npm
$ npm install --save @dlovely/mysql
# yarn
$ yarn add @dlovely/mysql
# pnpm
$ pnpm add @dlovely/mysql

使用

// mysql-table.ts
export const table1_columns = [
  { name: 'id', readonly: true, not_null: true, has_defa: true },
  { name: 'name', readonly: false, not_null: true, has_defa: false }
]
// mysql.ts
import { createMySqlPool } from '@dlovely/mysql'
import { table1_columns } from './mysql-table'

const server = createMySqlPool()
export const database = server.createDataBase('database')

export const table1 = database.createTable('table1', table1_columns)
// index.ts
import { table1 } from './mysql'

!async function() {
  const result = await table1.select()
  console.log(result)
}
1.1.0

11 months ago

1.0.1

12 months ago

1.0.0

12 months ago