Add en/0.5.x.md syntax highlighting

This commit is contained in:
vCaesar
2017-05-14 15:56:32 +08:00
parent 606e950ea3
commit 76e5d0f3b4
2 changed files with 38 additions and 38 deletions

View File

@@ -18,7 +18,7 @@ I'll use the first driver in the following examples (I use this one in my person
## Samples
In the following sections, I'll use the same database table structure for different databases, then create SQL as follows:
```sql
CREATE TABLE `userinfo` (
`uid` INT(10) NOT NULL AUTO_INCREMENT,
`username` VARCHAR(64) NULL DEFAULT NULL,
@@ -26,9 +26,9 @@ In the following sections, I'll use the same database table structure for differ
`created` DATE NULL DEFAULT NULL,
PRIMARY KEY (`uid`)
);
```
The following example shows how to operate on a database based on the `database/sql` interface standards.
```Go
package main
import (
@@ -102,7 +102,7 @@ The following example shows how to operate on a database based on the `database/
panic(err)
}
}
```
Let me explain a few of the important functions here:
- `sql.Open()` opens a registered database driver. The Go-MySQL-Driver registered the mysql driver here. The second argument is the DSN (Data Source Name) that defines information pertaining to the database connection. It supports following formats: