-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from GuoXiCheng/dev-c
update docs
- Loading branch information
Showing
8 changed files
with
303 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# 数据类型 | ||
|
||
## 存储类 | ||
|
||
每个存储在 SQLite 数据库中的值都具有以下存储类之一: | ||
|
||
| 存储类 | 描述 | | ||
| ------- | ------------------ | | ||
| NULL | 值是一个 NULL 值 | | ||
| INTEGER | 值是一个有符号整数 | | ||
| REAL | 值是一个浮点数 | | ||
| TEXT | 值是一个文本字符串 | | ||
| BLOB | 值是一个 blob 数据 | | ||
|
||
## Boolean 数据类型 | ||
|
||
SQLite 没有单独的 Boolean 存储类,布尔值被存储为整数 0(false)和 1(true)。 | ||
|
||
## 日期和时间数据类型 | ||
|
||
SQLite 没有单独的用于存储日期或时间的存储类,日期和时间被存储为 TEXT、REAL 或 INTEGER。 | ||
|
||
| 存储类 | 日期格式 | | ||
| ------- | -------------------------------------------------- | | ||
| TEXT | "YYYY-MM-DD HH:MM:SS.SSS" | | ||
| REAL | 从公元前 4714 年 11 月 24 日格林尼治时间开始的天数 | | ||
| INTEGER | 从 1970-01-01 00:00:00 UTC 开始的秒数 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 数据库操作 | ||
|
||
在命令行中输入`sqlite3`命令,进入 sqlite3 的命令行模式。 | ||
|
||
在命令行中输入`.quit`命令,退出 sqlite3 的命令行模式。 | ||
|
||
## 创建数据库 | ||
|
||
使用 `.open` 命令创建一个数据库文件,如果文件不存在则会创建一个新的数据库文件,如果文件已经存在则会打开该数据库文件。 | ||
|
||
```bash | ||
sqlite> .open test.db | ||
``` | ||
|
||
## 检查数据库 | ||
|
||
使用 `.databases` 命令查看当前打开的数据库文件。 | ||
|
||
```bash | ||
sqlite> .databases | ||
main: C:\sqlite\test.db r/w | ||
``` |
Oops, something went wrong.