sqlite3

command
v0.0.0-...-f6c5a1c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2017 License: MIT Imports: 6 Imported by: 0

README

SQLite

使用SQLite数据库实现的简单的增、删除、修改、查询例子。

运行前的准备

恢复依赖库

godep restore
编译前安装数据库驱动

一般情况下无需安装,如果没有,需提前安装好。

# Mac
brew install sqlite3
数据库文件

本例person.db已经创建完毕,可以直接使用。如果需要创建,按此下SQL脚本。

CREATE TABLE "person" (
  "id" INTEGER PRIMARY KEY AUTOINCREMENT,
  "name" TEXT,
  "phone" TEXT
)
配置文件

config.yaml,配置文件,配置数据库、日志。

运行样例

godep go run main.go person.go

编译

# Mac下编译
godep go build --tags "libsqlite3 darwin"

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL