Skip to content

Commit 628398e

Browse files
authored
chore: readme: Fix link, typos, copy editing (#974)
* chore: readme: Fix link, typos, copy editing Also closes #914, #939. * Update README.md
1 parent 3900dc3 commit 628398e

File tree

1 file changed

+55
-56
lines changed

1 file changed

+55
-56
lines changed

README.md

Lines changed: 55 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ go-sqlite3
77
[![codecov](https://codecov.io/gh/mattn/go-sqlite3/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-sqlite3)
88
[![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-sqlite3)](https://goreportcard.com/report/github.com/mattn/go-sqlite3)
99

10-
Latest stable version is v1.14 or later not v2.
10+
Latest stable version is v1.14 or later, not v2.
1111

1212
~~**NOTE:** The increase to v2 was an accident. There were no major changes or features.~~
1313

1414
# Description
1515

16-
sqlite3 driver conforming to the built-in database/sql interface
16+
A sqlite3 driver that conforms to the built-in database/sql interface.
1717

18-
Supported Golang version: See [.github/workflows/go.yaml](./.github/workflows/go.yaml)
18+
Supported Golang version: See [.github/workflows/go.yaml](./.github/workflows/go.yaml).
1919

20-
[This package follows the official Golang Release Policy.](https://golang.org/doc/devel/release.html#policy)
20+
This package follows the official [Golang Release Policy](https://golang.org/doc/devel/release.html#policy).
2121

2222
### Overview
2323

@@ -64,36 +64,36 @@ Supported Golang version: See [.github/workflows/go.yaml](./.github/workflows/go
6464

6565
# Installation
6666

67-
This package can be installed with the go get command:
67+
This package can be installed with the `go get` command:
6868

6969
go get github.com/mattn/go-sqlite3
7070

7171
_go-sqlite3_ is *cgo* package.
7272
If you want to build your app using go-sqlite3, you need gcc.
7373
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.
7474

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.***
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.***
7676

7777
# API Reference
7878

79-
API documentation can be found here: http://godoc.org/github.com/mattn/go-sqlite3
79+
API documentation can be found [here](http://godoc.org/github.com/mattn/go-sqlite3).
8080

81-
Examples can be found under the [examples](./_example) directory
81+
Examples can be found under the [examples](./_example) directory.
8282

8383
# Connection String
8484

8585
When creating a new SQLite database or connection to an existing one, with the file name additional options can be given.
86-
This is also known as a DSN string. (Data Source Name).
86+
This is also known as a DSN (Data Source Name) string.
8787

8888
Options are append after the filename of the SQLite database.
89-
The database filename and options are seperated by an `?` (Question Mark).
89+
The database filename and options are separated by an `?` (Question Mark).
9090
Options should be URL-encoded (see [url.QueryEscape](https://golang.org/pkg/net/url/#QueryEscape)).
9191

9292
This also applies when using an in-memory database instead of a file.
9393

9494
Options can be given using the following format: `KEYWORD=VALUE` and multiple options can be combined with the `&` ampersand.
9595

96-
This library supports dsn options of SQLite itself and provides additional options.
96+
This library supports DSN options of SQLite itself and provides additional options.
9797

9898
Boolean values can be one of:
9999
* `0` `no` `false` `off`
@@ -138,19 +138,18 @@ file:test.db?cache=shared&mode=memory
138138

139139
This package allows additional configuration of features available within SQLite3 to be enabled or disabled by golang build constraints also known as build `tags`.
140140

141-
[Click here for more information about build tags / constraints.](https://golang.org/pkg/go/build/#hdr-Build_Constraints)
141+
Click [here](https://golang.org/pkg/go/build/#hdr-Build_Constraints) for more information about build tags / constraints.
142142

143143
### Usage
144144

145-
If you wish to build this library with additional extensions / features.
146-
Use the following command.
145+
If you wish to build this library with additional extensions / features, use the following command:
147146

148147
```bash
149148
go build --tags "<FEATURE>"
150149
```
151150

152-
For available features see the extension list.
153-
When using multiple build tags, all the different tags should be space delimted.
151+
For available features, see the extension list.
152+
When using multiple build tags, all the different tags should be space delimited.
154153

155154
Example:
156155

@@ -181,9 +180,9 @@ go build --tags "icu json1 fts5 secure_delete"
181180

182181
# Compilation
183182

184-
This package requires `CGO_ENABLED=1` ennvironment variable if not set by default, and the presence of the `gcc` compiler.
183+
This package requires the `CGO_ENABLED=1` ennvironment variable if not set by default, and the presence of the `gcc` compiler.
185184

186-
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.
185+
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.
187186

188187
## Android
189188

@@ -198,7 +197,7 @@ For more information see [#201](https://github.com/mattn/go-sqlite3/issues/201)
198197

199198
# ARM
200199

201-
To compile for `ARM` use the following environment.
200+
To compile for `ARM` use the following environment:
202201

203202
```bash
204203
env CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ \
@@ -234,7 +233,7 @@ Please work only with compiled final binaries.
234233

235234
## Linux
236235

237-
To compile this package on Linux you must install the development tools for your linux distribution.
236+
To compile this package on Linux, you must install the development tools for your linux distribution.
238237

239238
To compile under linux use the build tag `linux`.
240239

@@ -250,7 +249,7 @@ go build --tags "libsqlite3 linux"
250249

251250
### Alpine
252251

253-
When building in an `alpine` container run the following command before building.
252+
When building in an `alpine` container run the following command before building:
254253

255254
```
256255
apk add --update gcc musl-dev
@@ -270,29 +269,29 @@ sudo apt-get install build-essential
270269

271270
## Mac OSX
272271

273-
OSX should have all the tools present to compile this package, if not install XCode this will add all the developers tools.
272+
OSX should have all the tools present to compile this package. If not, install XCode to add all the developers tools.
274273

275-
Required dependency
274+
Required dependency:
276275

277276
```bash
278277
brew install sqlite3
279278
```
280279

281-
For OSX there is an additional package install which is required if you wish to build the `icu` extension.
280+
For OSX, there is an additional package to install which is required if you wish to build the `icu` extension.
282281

283-
This additional package can be installed with `homebrew`.
282+
This additional package can be installed with `homebrew`:
284283

285284
```bash
286285
brew upgrade icu4c
287286
```
288287

289-
To compile for Mac OSX.
288+
To compile for Mac OSX:
290289

291290
```bash
292291
go build --tags "darwin"
293292
```
294293

295-
If you wish to link directly to libsqlite3 then you can use the `libsqlite3` build tag.
294+
If you wish to link directly to libsqlite3, use the `libsqlite3` build tag:
296295

297296
```
298297
go build --tags "libsqlite3 darwin"
@@ -304,14 +303,14 @@ Additional information:
304303

305304
## Windows
306305

307-
To compile this package on Windows OS you must have the `gcc` compiler installed.
306+
To compile this package on Windows, you must have the `gcc` compiler installed.
308307

309308
1) Install a Windows `gcc` toolchain.
310-
2) Add the `bin` folders to the Windows path if the installer did not do this by default.
311-
3) Open a terminal for the TDM-GCC toolchain, can be found in the Windows Start menu.
309+
2) Add the `bin` folder to the Windows path, if the installer did not do this by default.
310+
3) Open a terminal for the TDM-GCC toolchain, which can be found in the Windows Start menu.
312311
4) Navigate to your project folder and run the `go build ...` command for this package.
313312

314-
For example the TDM-GCC Toolchain can be found [here](https://sourceforge.net/projects/tdm-gcc/).
313+
For example the TDM-GCC Toolchain can be found [here](https://jmeubank.github.io/tdm-gcc/).
315314

316315
## Errors
317316

@@ -349,28 +348,28 @@ This package supports the SQLite User Authentication module.
349348
350349
## Compile
351350
352-
To use the User authentication module the package has to be compiled with the tag `sqlite_userauth`. See [Features](#features).
351+
To use the User authentication module, the package has to be compiled with the tag `sqlite_userauth`. See [Features](#features).
353352
354353
## Usage
355354
356355
### Create protected database
357356
358-
To create a database protected by user authentication provide the following argument to the connection string `_auth`.
357+
To create a database protected by user authentication, provide the following argument to the connection string `_auth`.
359358
This will enable user authentication within the database. This option however requires two additional arguments:
360359
361360
- `_auth_user`
362361
- `_auth_pass`
363362
364-
When `_auth` is present on the connection string user authentication will be enabled and the provided user will be created
363+
When `_auth` is present in the connection string user authentication will be enabled and the provided user will be created
365364
as an `admin` user. After initial creation, the parameter `_auth` has no effect anymore and can be omitted from the connection string.
366365
367-
Example connection string:
366+
Example connection strings:
368367
369-
Create an user authentication database with user `admin` and password `admin`.
368+
Create an user authentication database with user `admin` and password `admin`:
370369
371370
`file:test.s3db?_auth&_auth_user=admin&_auth_pass=admin`
372371
373-
Create an user authentication database with user `admin` and password `admin` and use `SHA1` for the password encoding.
372+
Create an user authentication database with user `admin` and password `admin` and use `SHA1` for the password encoding:
374373
375374
`file:test.s3db?_auth&_auth_user=admin&_auth_pass=admin&_auth_crypt=sha1`
376375
@@ -396,11 +395,11 @@ salt this can be configured with `_auth_salt`.
396395
397396
### Restrictions
398397
399-
Operations on the database regarding to user management can only be preformed by an administrator user.
398+
Operations on the database regarding user management can only be preformed by an administrator user.
400399
401400
### Support
402401
403-
The user authentication supports two kinds of users
402+
The user authentication supports two kinds of users:
404403
405404
- administrators
406405
- regular users
@@ -411,7 +410,7 @@ User management can be done by directly using the `*SQLiteConn` or by SQL.
411410
412411
#### SQL
413412
414-
The following sql functions are available for user management.
413+
The following sql functions are available for user management:
415414
416415
| Function | Arguments | Description |
417416
|----------|-----------|-------------|
@@ -420,7 +419,7 @@ The following sql functions are available for user management.
420419
| `auth_user_change` | username `string`, password `string`, admin `int` | Function to modify an user. Users can change their own password, but only an administrator can change the administrator flag. |
421420
| `authUserDelete` | username `string` | Delete an user from the database. Can only be used by an administrator. The current logged in administrator cannot be deleted. This is to make sure their is always an administrator remaining. |
422421
423-
These functions will return an integer.
422+
These functions will return an integer:
424423
425424
- 0 (SQLITE_OK)
426425
- 23 (SQLITE_AUTH) Failed to perform due to authentication or insufficient privileges
@@ -441,7 +440,7 @@ SELECT user_delete('user');
441440
442441
#### *SQLiteConn
443442
444-
The following functions are available for User authentication from the `*SQLiteConn`.
443+
The following functions are available for User authentication from the `*SQLiteConn`:
445444
446445
| Function | Description |
447446
|----------|-------------|
@@ -452,16 +451,16 @@ The following functions are available for User authentication from the `*SQLiteC
452451
453452
### Attached database
454453
455-
When using attached databases. SQLite will use the authentication from the `main` database for the attached database(s).
454+
When using attached databases, SQLite will use the authentication from the `main` database for the attached database(s).
456455
457456
# Extensions
458457
459-
If you want your own extension to be listed here or you want to add a reference to an extension; please submit an Issue for this.
458+
If you want your own extension to be listed here, or you want to add a reference to an extension; please submit an Issue for this.
460459
461460
## Spatialite
462461
463462
Spatialite is available as an extension to SQLite, and can be used in combination with this repository.
464-
For an example see [shaxbee/go-spatialite](https://github.com/shaxbee/go-spatialite).
463+
For an example, see [shaxbee/go-spatialite](https://github.com/shaxbee/go-spatialite).
465464
466465
## extension-functions.c from SQLite3 Contrib
467466
@@ -471,7 +470,7 @@ extension-functions.c is available as an extension to SQLite, and provides the f
471470
- String: replicate, charindex, leftstr, rightstr, ltrim, rtrim, trim, replace, reverse, proper, padl, padr, padc, strfilter.
472471
- Aggregate: stdev, variance, mode, median, lower_quartile, upper_quartile
473472
474-
For an example see [dinedal/go-sqlite3-extension-functions](https://github.com/dinedal/go-sqlite3-extension-functions).
473+
For an example, see [dinedal/go-sqlite3-extension-functions](https://github.com/dinedal/go-sqlite3-extension-functions).
475474
476475
# FAQ
477476
@@ -491,7 +490,7 @@ For an example see [dinedal/go-sqlite3-extension-functions](https://github.com/d
491490
492491
- Can I use this in multiple routines concurrently?
493492
494-
Yes for readonly. But, No for writable. See [#50](https://github.com/mattn/go-sqlite3/issues/50), [#51](https://github.com/mattn/go-sqlite3/issues/51), [#209](https://github.com/mattn/go-sqlite3/issues/209), [#274](https://github.com/mattn/go-sqlite3/issues/274).
493+
Yes for readonly. But not for writable. See [#50](https://github.com/mattn/go-sqlite3/issues/50), [#51](https://github.com/mattn/go-sqlite3/issues/51), [#209](https://github.com/mattn/go-sqlite3/issues/209), [#274](https://github.com/mattn/go-sqlite3/issues/274).
495494
496495
- Why I'm getting `no such table` error?
497496

@@ -505,7 +504,7 @@ For an example see [dinedal/go-sqlite3-extension-functions](https://github.com/d
505504

506505
Note that if the last database connection in the pool closes, the in-memory database is deleted. Make sure the [max idle connection limit](https://golang.org/pkg/database/sql/#DB.SetMaxIdleConns) is > 0, and the [connection lifetime](https://golang.org/pkg/database/sql/#DB.SetConnMaxLifetime) is infinite.
507506

508-
For more information see
507+
For more information see:
509508
* [#204](https://github.com/mattn/go-sqlite3/issues/204)
510509
* [#511](https://github.com/mattn/go-sqlite3/issues/511)
511510
* https://www.sqlite.org/sharedcache.html#shared_cache_and_in_memory_databases
@@ -515,20 +514,20 @@ For an example see [dinedal/go-sqlite3-extension-functions](https://github.com/d
515514

516515
OS X limits OS-wide to not have more than 1000 files open simultaneously by default.
517516

518-
For more information see [#289](https://github.com/mattn/go-sqlite3/issues/289)
517+
For more information, see [#289](https://github.com/mattn/go-sqlite3/issues/289)
519518

520519
- Trying to execute a `.` (dot) command throws an error.
521520

522521
Error: `Error: near ".": syntax error`
523-
Dot command are part of SQLite3 CLI not of this library.
522+
Dot command are part of SQLite3 CLI, not of this library.
524523

525524
You need to implement the feature or call the sqlite3 cli.
526525

527-
More information see [#305](https://github.com/mattn/go-sqlite3/issues/305)
526+
More information see [#305](https://github.com/mattn/go-sqlite3/issues/305).
528527

529528
- Error: `database is locked`
530529

531-
When you get a database is locked. Please use the following options.
530+
When you get a database is locked, please use the following options.
532531

533532
Add to DSN: `cache=shared`
534533

@@ -537,24 +536,24 @@ For an example see [dinedal/go-sqlite3-extension-functions](https://github.com/d
537536
db, err := sql.Open("sqlite3", "file:locked.sqlite?cache=shared")
538537
```
539538

540-
Second please set the database connections of the SQL package to 1.
539+
Next, please set the database connections of the SQL package to 1:
541540

542541
```go
543542
db.SetMaxOpenConns(1)
544543
```
545544

546-
More information see [#209](https://github.com/mattn/go-sqlite3/issues/209)
545+
For more information, see [#209](https://github.com/mattn/go-sqlite3/issues/209).
547546

548547
## Contributors
549548

550549
### Code Contributors
551550

552-
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
551+
This project exists thanks to all the people who [[contribute](CONTRIBUTING.md)].
553552
<a href="https://github.com/mattn/go-sqlite3/graphs/contributors"><img src="https://opencollective.com/mattn-go-sqlite3/contributors.svg?width=890&button=false" /></a>
554553

555554
### Financial Contributors
556555

557-
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/mattn-go-sqlite3/contribute)]
556+
Become a financial contributor and help us sustain our community. [[Contribute here](https://opencollective.com/mattn-go-sqlite3/contribute)].
558557

559558
#### Individuals
560559

0 commit comments

Comments
 (0)