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
Copy file name to clipboardExpand all lines: README.md
+32-26Lines changed: 32 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,12 +35,12 @@ This package follows the official [Golang Release Policy](https://golang.org/doc
35
35
-[Android](#android)
36
36
-[ARM](#arm)
37
37
-[Cross Compile](#cross-compile)
38
-
-[Google Cloud Platform](#google-cloud-platform)
38
+
-[Compiling](#compiling)
39
39
-[Linux](#linux)
40
40
-[Alpine](#alpine)
41
41
-[Fedora](#fedora)
42
42
-[Ubuntu](#ubuntu)
43
-
-[Mac OSX](#mac-osx)
43
+
-[macOS](#mac-osx)
44
44
-[Windows](#windows)
45
45
-[Errors](#errors)
46
46
-[User Authentication](#user-authentication)
@@ -70,9 +70,8 @@ This package can be installed with the `go get` command:
70
70
71
71
_go-sqlite3_ is *cgo* package.
72
72
If you want to build your app using go-sqlite3, you need gcc.
73
-
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.
74
73
75
-
***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.***
74
+
***Important: because this is a `CGO` enabled package, you are required to set the environment variable `CGO_ENABLED=1` and have a `gcc`compiler present within your path.***
76
75
77
76
# API Reference
78
77
@@ -145,7 +144,7 @@ Click [here](https://golang.org/pkg/go/build/#hdr-Build_Constraints) for more in
145
144
If you wish to build this library with additional extensions / features, use the following command:
146
145
147
146
```bash
148
-
go build --tags "<FEATURE>"
147
+
go build -tags "<FEATURE>"
149
148
```
150
149
151
150
For available features, see the extension list.
@@ -154,7 +153,7 @@ When using multiple build tags, all the different tags should be space delimited
| Allow URI Authority | sqlite_allow_uri_authority | URI filenames normally throws an error if the authority section is not either empty or "localhost".<br><br>However, if SQLite is compiled with the SQLITE_ALLOW_URI_AUTHORITY compile-time option, then the URI is converted into a Uniform Naming Convention (UNC) filename and passed down to the underlying operating system that way |
166
165
| App Armor | sqlite_app_armor | When defined, this C-preprocessor macro activates extra code that attempts to detect misuse of the SQLite API, such as passing in NULL pointers to required parameters or using objects after they have been destroyed. <br><br>App Armor is not available under `Windows`. |
167
166
| Disable Load Extensions | sqlite_omit_load_extension | Loading of external extensions is enabled by default.<br><br>To disable extension loading add the build tag `sqlite_omit_load_extension`. |
167
+
| Enable Serialization with `libsqlite3`| sqlite_serialize | Serialization and deserialization of a SQLite database is available by default, unless the build tag `libsqlite3` is set.<br><br>To enable this functionality even if `libsqlite3` is set, add the build tag `sqlite_serialize`. |
168
168
| Foreign Keys | sqlite_foreign_keys | This macro determines whether enforcement of foreign key constraints is enabled or disabled by default for new database connections.<br><br>Each database connection can always turn enforcement of foreign key constraints on and off and run-time using the foreign_keys pragma.<br><br>Enforcement of foreign key constraints is normally off by default, but if this compile-time parameter is set to 1, enforcement of foreign key constraints will be on by default |
169
169
| Full Auto Vacuum | sqlite_vacuum_full | Set the default auto vacuum to full |
170
170
| Incremental Auto Vacuum | sqlite_vacuum_incr | Set the default auto vacuum to incremental |
171
171
| Full Text Search Engine | sqlite_fts5 | When this option is defined in the amalgamation, versions 5 of the full-text search engine (fts5) is added to the build automatically |
172
172
| International Components for Unicode | sqlite_icu | This option causes the International Components for Unicode or "ICU" extension to SQLite to be added to the build |
173
173
| Introspect PRAGMAS | sqlite_introspect | This option adds some extra PRAGMA statements. <ul><li>PRAGMA function_list</li><li>PRAGMA module_list</li><li>PRAGMA pragma_list</li></ul> |
174
174
| JSON SQL Functions | sqlite_json | When this option is defined in the amalgamation, the JSON SQL functions are added to the build automatically |
175
+
| Math Functions | sqlite_math_functions | This compile-time option enables built-in scalar math functions. For more information see [Built-In Mathematical SQL Functions](https://www.sqlite.org/lang_mathfunc.html)|
175
176
| OS Trace | sqlite_os_trace | This option enables OSTRACE() debug logging. This can be verbose and should not be used in production. |
176
177
| Pre Update Hook | sqlite_preupdate_hook | Registers a callback function that is invoked prior to each INSERT, UPDATE, and DELETE operation on a database table. |
177
178
| 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 |
178
179
| Secure Delete (FAST) | sqlite_secure_delete_fast | For more information see [PRAGMA secure_delete](https://www.sqlite.org/pragma.html#pragma_secure_delete)|
| User Authentication | sqlite_userauth | SQLite User Authentication see [User Authentication](#user-authentication) for more information. |
182
+
| Virtual Tables | sqlite_vtable | SQLite Virtual Tables see [SQLite Official VTABLE Documentation](https://www.sqlite.org/vtab.html) for more information, and a [full example here](https://github.com/mattn/go-sqlite3/tree/master/_example/vtable)|
181
183
182
184
# Compilation
183
185
@@ -191,7 +193,7 @@ This package can be compiled for android.
191
193
Compile with:
192
194
193
195
```bash
194
-
go build --tags "android"
196
+
go build -tags "android"
195
197
```
196
198
197
199
For more information see [#201](https://github.com/mattn/go-sqlite3/issues/201)
@@ -216,21 +218,16 @@ This library can be cross-compiled.
216
218
217
219
In some cases you are required to the `CC` environment variable with the cross compiler.
218
220
219
-
## Cross Compiling from MAC OSX
220
-
The simplest way to cross compile from OSX is to use [xgo](https://github.com/karalabe/xgo).
221
+
## Cross Compiling from macOS
222
+
The simplest way to cross compile from macOS is to use [xgo](https://github.com/karalabe/xgo).
221
223
222
224
Steps:
223
-
- Install [xgo](https://github.com/karalabe/xgo) (`go get github.com/karalabe/xgo`).
224
-
- Ensure that your project is within your `GOPATH`.
0 commit comments