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
sqlite3 driver conforming to the built-in database/sql interface
12
12
13
+
Supported Golang version:
14
+
- 1.8.x
15
+
- 1.9.x
16
+
- 1.10.x
17
+
13
18
### Overview
14
19
15
20
-[Installation](#installation)
16
21
-[API Reference](#api-reference)
17
22
-[Features](#features)
23
+
-[Compilation](#compilation)
24
+
-[Android](#android)
25
+
-[ARM](#arm)
26
+
-[Cross Compile](#cross-compile)
27
+
-[Docker](#docker)
28
+
-[Alpine](#alpine)
29
+
-[Google Cloud Platform](#google-cloud-platform)
30
+
-[Linux](#linux)
31
+
-[Fedora](#fedora)
32
+
-[Ubuntu](#ubuntu)
33
+
-[Mac OSX](#mac-osx)
34
+
-[Windows](#windows)
35
+
-[Errors](#errors)
18
36
-[FAQ](#faq)
19
37
-[License](#license)
20
38
@@ -28,6 +46,8 @@ _go-sqlite3_ is *cgo* package.
28
46
If you want to build your app using go-sqlite3, you need gcc.
29
47
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.
30
48
49
+
***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.***
50
+
31
51
# API Reference
32
52
33
53
API documentation can be found here: http://godoc.org/github.com/mattn/go-sqlite3
@@ -40,6 +60,26 @@ This package allows additional configuration of features available within SQLite
40
60
41
61
[Click here for more information about build tags / constraints.](https://golang.org/pkg/go/build/#hdr-Build_Constraints)
42
62
63
+
### Usage
64
+
65
+
If you wish to build this library with additional extensions / features.
66
+
Use the following command.
67
+
68
+
```bash
69
+
go build --tags "<FEATURE>"
70
+
```
71
+
72
+
For available features see the extension list.
73
+
When using multiple build tags, all the different tags should be space delimted.
74
+
75
+
Example:
76
+
77
+
```bash
78
+
go build --tags "icu json1 fts5 secure_delete"
79
+
```
80
+
81
+
### Feature / Extension List
82
+
43
83
| Extension | Build Tag | Description |
44
84
|-----------|-----------|-------------|
45
85
| Additional Statistics | sqlite_stat4 | This option adds additional logic to the ANALYZE command and to the query planner that can help SQLite to chose a better query plan under certain situations. The ANALYZE command is enhanced to collect histogram data from all columns of every index and store that data in the sqlite_stat4 table.<br><br>The query planner will then use the histogram data to help it make better index choices. The downside of this compile-time option is that it violates the query planner stability guarantee making it more difficult to ensure consistent performance in mass-produced applications.<br><br>SQLITE_ENABLE_STAT4 is an enhancement of SQLITE_ENABLE_STAT3. STAT3 only recorded histogram data for the left-most column of each index whereas the STAT4 enhancement records histogram data from all columns of each index.<br><br>The SQLITE_ENABLE_STAT3 compile-time option is a no-op and is ignored if the SQLITE_ENABLE_STAT4 compile-time option is used |
@@ -56,33 +96,166 @@ This package allows additional configuration of features available within SQLite
56
96
| Secure Delete | sqlite_secure_delete | This compile-time option changes the default setting of the secure_delete pragma.<br><br>When this option is not used, secure_delete defaults to off. When this option is present, secure_delete defaults to on.<br><br>The secure_delete setting causes deleted content to be overwritten with zeros. There is a small performance penalty since additional I/O must occur.<br><br>On the other hand, secure_delete can prevent fragments of sensitive information from lingering in unused parts of the database file after it has been deleted. See the documentation on the secure_delete pragma for additional information |
This package requires `CGO_ENABLED=1` ennvironment variable if not set by default, and the presence of the `gcc` compiler.
102
+
103
+
If you need to add additional CFLAGS or LDFLAGS to the build command, and do not want to modify this package. Then this can be achieved by using the `CGO_CFLAGS` and `CGO_LDFLAGS` environment variables.
104
+
105
+
## Android
106
+
107
+
This package can be compiled for android.
108
+
Compile with:
109
+
110
+
```bash
111
+
go build --tags "android"
112
+
```
113
+
114
+
For more information see [#201](https://github.com/mattn/go-sqlite3/issues/201)
115
+
116
+
# ARM
117
+
118
+
To compile for `ARM` use the following environment.
0 commit comments