## 原生操作
>[info]查询数据
~~~
db.query('select * from user')
~~~
>[info]新增数据
~~~
db.execute("insert into user (name, age) values ('admin', 25)")
~~~
>[info]更新数据
~~~
db.execute('update user set status = 1 where id = 1')
~~~
>[info]删除数据
~~~
db.execute('delete from user where id = 1')
~~~
>[info]清空数据表
~~~
db.query('truncate table user')
~~~
>[danger]以上操作成功返回1,失败返回0,如果操作失败,数据库会自动回滚
- 连接数据库
- 链式操作方法
- distinct
- field
- withoutField
- name
- alias
- force
- join
- leftJoin
- rightJoin
- union
- unionAll
- where
- whereOr
- whereTime
- whereBetweenTime
- whereNotBetweenTime
- whereBetweenTimeField
- whereNotBetweenTimeField
- whereYear
- whereMonth
- whereWeek
- whereDay
- group
- having
- order
- orderRand
- limit
- page
- lock
- comment
- ignore
- inc
- dec
- fetchSql
- 查询数据
- 聚合查询
- 新增数据
- 更新数据
- 删除数据
- 原生操作