From efddcade4ccaad32bf4426c401b2256516ab80b8 Mon Sep 17 00:00:00 2001 From: Zhang Peng Date: Mon, 25 Feb 2019 16:48:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=20markdown=20?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codes/redis/redis-config/sentinel3/README.md | 2 +- codes/redis/redis-in-action-py/README.md | 2 +- docs/flyway.md | 20 ++-- docs/h2.md | 102 +++++++++---------- docs/postgresql.md | 4 +- docs/redis/Redis事件.md | 2 +- 6 files changed, 66 insertions(+), 66 deletions(-) diff --git a/codes/redis/redis-config/sentinel3/README.md b/codes/redis/redis-config/sentinel3/README.md index f574a30..46fe7de 100644 --- a/codes/redis/redis-config/sentinel3/README.md +++ b/codes/redis/redis-config/sentinel3/README.md @@ -9,4 +9,4 @@

图:一主两从三哨兵

-
\ No newline at end of file + diff --git a/codes/redis/redis-in-action-py/README.md b/codes/redis/redis-in-action-py/README.md index 6b3b004..02a6cf9 100644 --- a/codes/redis/redis-in-action-py/README.md +++ b/codes/redis/redis-in-action-py/README.md @@ -1,3 +1,3 @@ # Redis 实战(Redis In Action)源码 -搬运自:https://github.com/huangz1990/riacn-code \ No newline at end of file +搬运自:https://github.com/huangz1990/riacn-code diff --git a/docs/flyway.md b/docs/flyway.md index 32ab1a7..0cdd8dd 100644 --- a/docs/flyway.md +++ b/docs/flyway.md @@ -37,7 +37,7 @@ (2)对于大多数项目而言,最简单的持续集成场景如下所示: -![flyway-sample](https://flywaydb.org/assets/balsamiq/Environments.png) +

这意味着,我们不仅仅要处理一份环境中的修改,由此会引入一些版本冲突问题: @@ -68,13 +68,13 @@ 最简单的场景是指定 Flyway 迁移到一个空的数据库。 -![image](http://upload-images.jianshu.io/upload_images/3101171-bb6e9f39e56ebbda.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

Flyway 会尝试查找它的 schema 历史表,如果数据库是空的,Flyway 就不再查找,而是直接创建数据库。 现再你就有了一个仅包含一张空表的数据库,默认情况下,这张表叫 _flyway_schema_history_。 -![image](http://upload-images.jianshu.io/upload_images/3101171-410eb31c6313b389.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

这张表将被用于追踪数据库的状态。 @@ -82,17 +82,17 @@ Flyway 会尝试查找它的 schema 历史表,如果数据库是空的,Flywa 这些 **migrations** 将根据他们的版本号进行排序。 -![image](http://upload-images.jianshu.io/upload_images/3101171-d36ee07ada4efbcd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

任意 migration 应用后,schema 历史表将更新。当元数据和初始状态替换后,可以称之为:迁移到新版本。 Flyway 一旦扫描了文件系统或应用 classpath 下的 migrations,这些 migrations 会检查 schema 历史表。如果它们的版本号低于或等于当前的版本,将被忽略。保留下来的 migrations 是等待的 migrations,有效但没有应用。 -![image](http://upload-images.jianshu.io/upload_images/3101171-99a88fea7a31a070.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

migrations 将根据版本号排序并按序执行。 -![image](http://upload-images.jianshu.io/upload_images/3101171-b444fef6e5c13b71.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

## 快速上手 @@ -405,7 +405,7 @@ migrations 最常用的编写形式就是 SQL。 为了被 Flyway 自动识别,SQL migrations 的文件命名必须遵循规定的模式: -![sql-migrations](https://raw.githubusercontent.com/dunwu/Database/master/images/flyway/sql-migrations.png) +

- **Prefix** - `V` 代表 versioned migrations (可配置), `U` 代表 undo migrations (可配置)、 `R` 代表 repeatable migrations (可配置) - **Version** - 版本号通过`.`(点)或`_`(下划线)分隔 (repeatable migrations 不需要) @@ -424,7 +424,7 @@ migrations 最常用的编写形式就是 SQL。 为了被 Flyway 自动识别,JAVA migrations 的文件命名必须遵循规定的模式: -![java-migrations](https://raw.githubusercontent.com/dunwu/Database/master/images/flyway/java-migrations.png) +

- **Prefix** - `V` 代表 versioned migrations (可配置), `U` 代表 undo migrations (可配置)、 `R` 代表 repeatable migrations (可配置) - **Version** - 版本号通过`.`(点)或`_`(下划线)分隔 (repeatable migrations 不需要) @@ -447,13 +447,13 @@ Callbacks 可以用 SQL 或 JAVA 来实现。 SQL Callbacks 的命名规则为:event 名 + SQL migration。 -如: `beforeMigrate.sql`, `beforeEachMigrate.sql`, `afterEachMigrate.sql` 等。 +如: `beforeMigrate.sql`, `beforeEachMigrate.sql`, `afterEachMigrate.sql` 等。 SQL Callbacks 也可以包含描述(description)。这种情况下,SQL Callbacks 文件名 = event 名 + 分隔符 + 描述 + 后缀。例:`beforeRepair__vacuum.sql` 当同一个 event 有多个 SQL callbacks,将按照它们描述(description)的顺序执行。 -> **注:** Flyway 也支持你配置的  `sqlMigrationSuffixes`。 +> **注:** Flyway 也支持你配置的 `sqlMigrationSuffixes`。 ##### JAVA Callbacks diff --git a/docs/h2.md b/docs/h2.md index eab6d56..04da69e 100644 --- a/docs/h2.md +++ b/docs/h2.md @@ -36,11 +36,11 @@ H2 允许用户通过浏览器接口方式访问 SQL 数据库。 2. 启动方式:在 bin 目录下,双击 jar 包;执行 `java -jar h2*.jar`;执行脚本:`h2.bat` 或 `h2.sh`。 3. 在浏览器中访问:http://localhost:8082,应该可以看到下图中的页面: -![h2-console](https://raw.githubusercontent.com/dunwu/Database/master/images/h2/h2-console.png) +

点击 **Connect** ,可以进入操作界面: -![h2-console](https://raw.githubusercontent.com/dunwu/Database/master/images/h2/h2-console-02.png) +

操作界面十分简单,不一一细说。 @@ -105,9 +105,9 @@ Datasource class: `org.h2.jdbcx.JdbcDataSource` 数据库持久化存储为单个文件。 -连接字符串:`~/.h2/DBName` 表示数据库文件的存储位置,如果第一次连接则会自动创建数据库。 +连接字符串:`\~/.h2/DBName` 表示数据库文件的存储位置,如果第一次连接则会自动创建数据库。 -- `jdbc:h2:~/test` - 'test' 在用户根目录下 +- `jdbc:h2:\~/test` - 'test' 在用户根目录下 - `jdbc:h2:/data/test` - 'test' 在 /data 目录下 - `jdbc:h2:test` - 'test' 在当前工作目录 @@ -119,8 +119,8 @@ Datasource class: `org.h2.jdbcx.JdbcDataSource` 如果不指定 DBName,则以私有方式启动,只允许一个连接。 -- `jdbc:h2:mem:test` -  一个进程中有多个连接 -- `jdbc:h2:mem:` -  未命名的私有库,一个连接 +- `jdbc:h2:mem:test` - 一个进程中有多个连接 +- `jdbc:h2:mem:` - 未命名的私有库,一个连接 #### 服务模式 @@ -132,7 +132,7 @@ H2 支持三种服务模式: 启动 tcp 服务连接字符串示例: -- `jdbc:h2:tcp://localhost/~/test` - 用户根目录 +- `jdbc:h2:tcp://localhost/\~/test` - 用户根目录 - `jdbc:h2:tcp://localhost//data/test` - 绝对路径 #### 启动服务 @@ -155,8 +155,8 @@ java -cp h2*.jar org.h2.tools.Server -? #### 设置 -- `jdbc:h2:..;MODE=MySQL`  兼容模式(或 HSQLDB 等) -- `jdbc:h2:..;TRACE_LEVEL_FILE=3`  记录到 `*.trace.db` +- `jdbc:h2:..;MODE=MySQL` 兼容模式(或 HSQLDB 等) +- `jdbc:h2:..;TRACE_LEVEL_FILE=3` 记录到 `*.trace.db` #### 连接字符串参数 @@ -272,184 +272,184 @@ java -jar h2-1.3.168.jar -web -webPort 8090 -browser ### SELECT -![SELECT](http://upload-images.jianshu.io/upload_images/3101171-a3f90c0d1f1f3437.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### INSERT -![INSERT](http://upload-images.jianshu.io/upload_images/3101171-6a92ae4362c3468a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### UPDATE -![UPDATE](http://upload-images.jianshu.io/upload_images/3101171-dddf0e26995d46c3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### DELETE -![DELETE](http://upload-images.jianshu.io/upload_images/3101171-96e72023445a6fd6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### BACKUP -![BACKUP](http://upload-images.jianshu.io/upload_images/3101171-6267894d24fab47f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### EXPLAIN -![EXPLAIN](http://upload-images.jianshu.io/upload_images/3101171-bbed6bb69f998b7a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

7、MERGE -![](http://upload-images.jianshu.io/upload_images/3101171-bd021648431d12a7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### RUNSCRIPT 运行 sql 脚本文件 -![RUNSCRIPT](http://upload-images.jianshu.io/upload_images/3101171-d6fe03eff0037e14.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### SCRIPT 根据数据库创建 sql 脚本 -![SCRIPT](http://upload-images.jianshu.io/upload_images/3101171-9ba7547ab8bcaeab.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### SHOW -![SHOW](http://upload-images.jianshu.io/upload_images/3101171-67449c6cc5cbb8c1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### ALTER #### ALTER INDEX RENAME -![ALTER INDEX RENAME](http://upload-images.jianshu.io/upload_images/3101171-230bd3f97e185d2f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

#### ALTER SCHEMA RENAME -![ALTER SCHEMA RENAME](http://upload-images.jianshu.io/upload_images/3101171-797a028938e46ba3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

#### ALTER SEQUENCE -![ALTER SEQUENCE](http://upload-images.jianshu.io/upload_images/3101171-46f343da1b6c6a29.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

#### ALTER TABLE -![ALTER TABLE](http://upload-images.jianshu.io/upload_images/3101171-7e146a4010f2f357.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

##### 增加约束 -![增加约束](http://upload-images.jianshu.io/upload_images/3101171-4e5605a9c87a79cb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

##### 修改列 -![修改列](http://upload-images.jianshu.io/upload_images/3101171-fbc1358c553e6614.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

##### 删除列 -![删除列](http://upload-images.jianshu.io/upload_images/3101171-dc3b897413700981.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

##### 删除序列 -![删除序列](http://upload-images.jianshu.io/upload_images/3101171-ec83899cb8724966.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

#### ALTER USER ##### 修改用户名 -![修改用户名](http://upload-images.jianshu.io/upload_images/3101171-a1e429c0d8ece66c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

##### 修改用户密码 -![修改用户密码](http://upload-images.jianshu.io/upload_images/3101171-5b86f98796606e54.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

#### ALTER VIEW -![ALTER VIEW](http://upload-images.jianshu.io/upload_images/3101171-8832ecbc2db63a13.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### COMMENT -![COMMENT](http://upload-images.jianshu.io/upload_images/3101171-467ce031883f0020.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### CREATE CONSTANT -![CREATE CONSTANT](http://upload-images.jianshu.io/upload_images/3101171-1231c83563bfec9c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### CREATE INDEX -![CREATE INDEX](http://upload-images.jianshu.io/upload_images/3101171-d66d59bd7803d5c1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### CREATE ROLE -![CREATE ROLE](http://upload-images.jianshu.io/upload_images/3101171-7df1dee098e1127b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### CREATE SCHEMA -![CREATE SCHEMA](http://upload-images.jianshu.io/upload_images/3101171-c485123c62c0866e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### CREATE SEQUENCE -![CREATE SEQUENCE](http://upload-images.jianshu.io/upload_images/3101171-cc25860776d361ae.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### CREATE TABLE -![CREATE TABLE](http://upload-images.jianshu.io/upload_images/3101171-36ffc66327df8b5b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### CREATE TRIGGER -![CREATE TRIGGER](http://upload-images.jianshu.io/upload_images/3101171-9a7bfa4425281213.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### CREATE USER -![CREATE USER](http://upload-images.jianshu.io/upload_images/3101171-a1e45e308be6dac3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### CREATE VIEW -![CREATE VIEW](http://upload-images.jianshu.io/upload_images/3101171-45c4cd516fd36611.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### DROP -![DROP](http://upload-images.jianshu.io/upload_images/3101171-52a3562d76411811.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### GRANT RIGHT 给 schema 授权授权 -![授权](http://upload-images.jianshu.io/upload_images/3101171-750e96ceff00c4ee.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

给 schema 授权给 schema 授权 -![给schema授权](http://upload-images.jianshu.io/upload_images/3101171-22cfd65c2ff1eea5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

#### 复制角色的权限 -![复制角色的权限](http://upload-images.jianshu.io/upload_images/3101171-6cba2f1585fd913b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### REVOKE RIGHT #### 移除授权 -![移除授权](http://upload-images.jianshu.io/upload_images/3101171-3f905669cbb331b7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

#### 移除角色具有的权限 -![移除角色具有的权限](http://upload-images.jianshu.io/upload_images/3101171-af77f495222f1b30.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### ROLLBACK #### 从某个还原点(savepoint)回滚 -![](http://upload-images.jianshu.io/upload_images/3101171-c71a226ac4fff913.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

#### 回滚事务 -![](http://upload-images.jianshu.io/upload_images/3101171-efb65c504c7d69c2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

#### 创建 savepoint -![](http://upload-images.jianshu.io/upload_images/3101171-feefdc236d4b211d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

## 数据类型 -![数据类型](http://upload-images.jianshu.io/upload_images/3101171-52296dd53249cdae.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

### INT Type -![INT Type](http://upload-images.jianshu.io/upload_images/3101171-fe62e3d07eb93d11.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) +

## 集群 diff --git a/docs/postgresql.md b/docs/postgresql.md index a065de1..0df9deb 100644 --- a/docs/postgresql.md +++ b/docs/postgresql.md @@ -4,7 +4,7 @@ > > 关键词:Database, RDBM, psql -![](http://oyz7npk35.bkt.clouddn.com/images/20180920181010182614.png) +

@@ -26,7 +26,7 @@ 官方下载页面要求用户选择相应版本,然后动态的给出安装提示,如下图所示: -![](http://oyz7npk35.bkt.clouddn.com/images/20180920181010174348.png) +

前 3 步要求用户选择,后 4 步是根据选择动态提示的安装步骤 diff --git a/docs/redis/Redis事件.md b/docs/redis/Redis事件.md index 1fecfa1..8d119e4 100644 --- a/docs/redis/Redis事件.md +++ b/docs/redis/Redis事件.md @@ -81,4 +81,4 @@ def main():
-
\ No newline at end of file +