Skip to content

Commit

Permalink
docs for using sqlite3 extensions
Browse files Browse the repository at this point in the history
docs for using sqlite3 extensions
  • Loading branch information
missinglink committed Oct 3, 2016
1 parent 88f3ff2 commit 252b0db
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,32 @@ Note that these databases are not covered by CI and I (@coopernurse) have no goo
test them locally. So please try them and send patches as needed, but expect a bit more
unpredicability.

## Sqlite3 Extensions

In order to use sqlite3 extensions you need to first register a custom driver:

```go
import (
"database/sql"

// use whatever database/sql driver you wish
sqlite "github.com/mattn/go-sqlite3"
)

func customDriver() (*sql.DB, error) {

// create custom driver with extensions defined
sql.Register("sqlite3-custom", &sqlite.SQLiteDriver{
Extensions: []string{
"mod_spatialite",
},
})

// now you can then connect using the 'sqlite3-custom' driver instead of 'sqlite3'
return sql.Open("sqlite3-custom", "/tmp/post_db.bin")
}
```

## Known Issues

### SQL placeholder portability
Expand Down

0 comments on commit 252b0db

Please sign in to comment.