@@ -8,22 +8,6 @@ gorm 是一组数据库操作命令行工具。
8
8
9
9
` git clone https://github.com/liangyt123/gorm `
10
10
11
- 同时你需要安装如下依赖:
12
-
13
- * github.com/go-xorm/xorm
14
-
15
- * Mysql: [ github.com/go-sql-driver/mysql] ( https://github.com/go-sql-driver/mysql )
16
-
17
- * MyMysql: [ github.com/ziutek/mymysql/godrv] ( https://github.com/ziutek/mymysql/godrv )
18
-
19
- * Postgres: [ github.com/lib/pq] ( https://github.com/lib/pq )
20
-
21
- * SQLite: [ github.com/mattn/go-sqlite3] ( https://github.com/mattn/go-sqlite3 )
22
-
23
- * MSSQL: [ github.com/denisenkom/go-mssqldb] ( https://github.com/denisenkom/go-mssqldb )
24
-
25
- ** 对于sqlite3的支持,你需要自己进行编译 ` go build -tags sqlite3 ` 因为sqlite3需要cgo的支持。
26
-
27
11
## 命令列表
28
12
29
13
有如下可用的命令:
@@ -52,13 +36,13 @@ sqlite:
52
36
` gorm reverse sqite3 test.db templates/gogorm `
53
37
54
38
mysql:
55
- ` xorm reverse mysql root:@/xorm_test ?charset=utf8 templates/goxorm `
39
+ ` gorm reverse mysql ' root:123456@tcp(127.0.0.1:3306)/gorm_test' ?charset=utf8 templates/gogorm `
56
40
57
41
mymysql:
58
- ` xorm reverse mymysql xorm_test2 /root/ templates/goxorm `
42
+ ` gorm reverse mymysql gorm_test2 /root/ templates/gogorm `
59
43
60
44
postgres:
61
- ` xorm reverse postgres "dbname=xorm_test sslmode=disable" templates/goxorm `
45
+ ` gorm reverse postgres "dbname=gorm_test sslmode=disable" templates/gogorm `
62
46
63
47
之后将会生成代码 generated go files in ` ./model ` directory
64
48
@@ -78,18 +62,18 @@ genJson=1
78
62
79
63
Shell command provides a tool to operate database. For example, you can create table, alter table, insert data, delete data and etc.
80
64
81
- ` xorm shell sqlite3 test.db` will connect to the sqlite3 database and you can type ` help ` to list all the shell commands.
65
+ ` gorm shell sqlite3 test.db` will connect to the sqlite3 database and you can type ` help ` to list all the shell commands.
82
66
83
67
## Dump
84
68
85
69
Dump command provides a tool to dump all database structs and data as SQL to your standard output.
86
70
87
- ` xorm dump sqlite3 test.db` could dump sqlite3 database test.db to standard output. If you want to save to file, just
88
- type ` xorm dump sqlite3 test.db > test.sql` .
71
+ ` gorm dump sqlite3 test.db` could dump sqlite3 database test.db to standard output. If you want to save to file, just
72
+ type ` gorm dump sqlite3 test.db > test.sql` .
89
73
90
74
## Source
91
75
92
- ` xorm source sqlite3 test.db < test.sql` will execute sql file on the test.db.
76
+ ` gorm source sqlite3 test.db < test.sql` will execute sql file on the test.db.
93
77
94
78
## Driver
95
79
0 commit comments