Add en/0.5.x.md syntax highlighting
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user