diff --git a/Makefile b/Makefile index da9b57af..f842b791 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,10 @@ OUTPUT ?= dbmate GOOS := $(shell go env GOOS) ifeq ($(GOOS),linux) # statically link binaries to support alpine linux - override FLAGS := -tags netgo,osusergo,sqlite_omit_load_extension,sqlite_json -ldflags '-s -extldflags "-static"' $(FLAGS) + override FLAGS := -tags netgo,osusergo,sqlite_omit_load_extension,sqlite_fts5,sqlite_json -ldflags '-s -extldflags "-static"' $(FLAGS) else # strip binaries - override FLAGS := -tags sqlite_omit_load_extension,sqlite_json -ldflags '-s' $(FLAGS) + override FLAGS := -tags sqlite_omit_load_extension,sqlite_fts5,sqlite_json -ldflags '-s' $(FLAGS) endif ifeq ($(GOOS),darwin) export SDKROOT ?= $(shell xcrun --sdk macosx --show-sdk-path) diff --git a/pkg/driver/sqlite/sqlite_test.go b/pkg/driver/sqlite/sqlite_test.go index 895ef994..87fffa6c 100644 --- a/pkg/driver/sqlite/sqlite_test.go +++ b/pkg/driver/sqlite/sqlite_test.go @@ -405,3 +405,12 @@ func TestSQLiteQuotedMigrationsTableName(t *testing.T) { require.Equal(t, `"fooMigrations"`, name) }) } + +func TestSQLiteFTS5Available(t *testing.T) { + db := prepTestSQLiteDB(t) + defer dbutil.MustClose(db) + + // this only passes if the FTS5 module is statically compiled in to the SQLite driver + _, err := db.Exec("CREATE VIRTUAL TABLE a USING fts5(b, c)") + require.NoError(t, err) +}