Skip to content

Commit

Permalink
Soundex.
Browse files Browse the repository at this point in the history
  • Loading branch information
ncruces committed Jul 26, 2023
1 parent a86937a commit bdfe279
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions embed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The following optional features are compiled in:
- [JSON](https://www.sqlite.org/json1.html)
- [R*Tree](https://www.sqlite.org/rtree.html)
- [GeoPoly](https://www.sqlite.org/geopoly.html)
- [soundex](https://www.sqlite.org/lang_corefunc.html#soundex)
- [base64](https://github.com/sqlite/sqlite/blob/master/ext/misc/base64.c)
- [decimal](https://github.com/sqlite/sqlite/blob/master/ext/misc/decimal.c)
- [regexp](https://github.com/sqlite/sqlite/blob/master/ext/misc/regexp.c)
Expand Down
Binary file modified embed/sqlite3.wasm
Binary file not shown.
8 changes: 3 additions & 5 deletions ext/unicode/unicode.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,10 @@ func like(ctx sqlite3.Context, arg ...sqlite3.Value) {

re, ok := ctx.GetAuxData(0).(likeData)
if !ok || re.escape != escape {
r, err := regexp.Compile(like2regex(arg[0].Text(), escape))
if err != nil {
ctx.ResultError(err)
return
re = likeData{
regexp.MustCompile(like2regex(arg[0].Text(), escape)),
escape,
}
re = likeData{r, escape}
ctx.SetAuxData(0, re)
}
ctx.ResultBool(re.Match(arg[1].RawBlob()))
Expand Down
2 changes: 1 addition & 1 deletion gormlite/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ require (
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/ncruces/julianday v0.1.5 // indirect
github.com/tetratelabs/wazero v1.2.1 // indirect
github.com/tetratelabs/wazero v1.3.1 // indirect
golang.org/x/sys v0.10.0 // indirect
)
4 changes: 2 additions & 2 deletions gormlite/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ github.com/ncruces/go-sqlite3 v0.8.2 h1:U28YYK/Kl5aUsRljcnvShZZHBgWLzuR26zUntP4u
github.com/ncruces/go-sqlite3 v0.8.2/go.mod h1:yGeN+m3ug1wD/+Kg2A3TnochT6H6Or6+2q8KHN//r9k=
github.com/ncruces/julianday v0.1.5 h1:hDJ9ejiMp3DHsoZ5KW4c1lwfMjbARS7u/gbYcd0FBZk=
github.com/ncruces/julianday v0.1.5/go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g=
github.com/tetratelabs/wazero v1.2.1 h1:J4X2hrGzJvt+wqltuvcSjHQ7ujQxA9gb6PeMs4qlUWs=
github.com/tetratelabs/wazero v1.2.1/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ=
github.com/tetratelabs/wazero v1.3.1 h1:rnb9FgOEQRLLR8tgoD1mfjNjMhFeWRUk+a4b4j/GpUM=
github.com/tetratelabs/wazero v1.3.1/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ=
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58=
Expand Down
3 changes: 3 additions & 0 deletions sqlite3/sqlite_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#define SQLITE_USE_ALLOCA

// Other Options

#define SQLITE_ALLOW_URI_AUTHORITY
#define SQLITE_ENABLE_BATCH_ATOMIC_WRITE
#define SQLITE_ENABLE_ATOMIC_WRITE
Expand All @@ -55,5 +56,7 @@
// #define SQLITE_ENABLE_SESSION
// #define SQLITE_ENABLE_PREUPDATE_HOOK

#define SQLITE_SOUNDEX

// Implemented in vfs.c.
int localtime_s(struct tm *const pTm, time_t const *const pTime);

0 comments on commit bdfe279

Please sign in to comment.