You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
go-sqlite3-encrypt is go-sqlite3 with sqlcipher. follow the instructions below, the cipher extension will be builtin by default.
11
-
12
-
you have 2 ways to enable cipher:
13
8
14
-
1. DSN
15
-
1. You can try DSN like this, `sql.Open("sqlite3", "file:dbFileName?_crypto_key=auxten")`
16
-
1. PRAGMA
17
-
1. After Open db, before execute any statement do `db.Exec("PRAGMA key = auxten;")`
9
+
go-sqlite3-encrypt is go-sqlite3 with sqlcipher. follow the instructions below, the cipher extension will be builtin by default.
18
10
11
+
For easy building, I also put libTomCrypt related files in project.
19
12
20
13
sqlite3 driver conforming to the built-in database/sql interface
21
14
@@ -28,6 +21,7 @@ Supported Golang version:
28
21
### Overview
29
22
30
23
-[Installation](#installation)
24
+
-[HowTo Encrypt](#howto-encrypt)
31
25
-[API Reference](#api-reference)
32
26
-[Connection String](#connection-string)
33
27
-[Features](#features)
@@ -55,14 +49,32 @@ Supported Golang version:
55
49
56
50
This package can be installed with the go get command:
57
51
58
-
go get github.com/mattn/go-sqlite3
52
+
go get github.com/CovenantSQL/go-sqlite3-encrypt
59
53
60
54
_go-sqlite3_ is *cgo* package.
61
55
If you want to build your app using go-sqlite3, you need gcc.
62
-
However, after you have built and installed _go-sqlite3_ with `go install github.com/mattn/go-sqlite3` (which requires gcc), you can build your app without relying on gcc in future.
56
+
However, after you have built and installed _go-sqlite3_ with `go install github.com/CovenantSQL/go-sqlite3-encrypt` (which requires gcc), you can build your app without relying on gcc in future.
63
57
64
58
***Important: because this is a `CGO` enabled package you are required to set the environment variable `CGO_ENABLED=1` and have a `gcc` compile present within your path.***
65
59
60
+
# HowTo Encrypt
61
+
62
+
You have 2 ways to enable encryption:
63
+
64
+
### DSN
65
+
66
+
1. You can try DSN like this, `sql.Open("sqlite3", "file:dbFileName?_crypto_key=auxten")`
67
+
### PRAGMA
68
+
69
+
1. After Open db, before execute any statement do `db.Exec("PRAGMA key = auxten;")`
70
+
71
+
Thanks for the great works of [sqlcipher](https://github.com/sqlcipher/sqlcipher), [libtomcrypt](https://github.com/libtom/libtomcrypt) and [go-sqlite3](https://github.com/mattn/go-sqlite3)
72
+
73
+
For more details:
74
+
1.https://github.com/sqlcipher/sqlcipher
75
+
1.https://github.com/libtom/libtomcrypt
76
+
1.https://github.com/mattn/go-sqlite3
77
+
66
78
# API Reference
67
79
68
80
API documentation can be found here: http://godoc.org/github.com/mattn/go-sqlite3
0 commit comments