Skip to content

Commit

Permalink
Implemented Full-Text indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
Hydrocharged committed Jul 26, 2023
1 parent 6c3d856 commit 0dd97f6
Show file tree
Hide file tree
Showing 24 changed files with 1,237 additions and 118 deletions.
215 changes: 214 additions & 1 deletion go/gen/fb/serial/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ require (
github.com/cespare/xxhash v1.1.0
github.com/creasty/defaults v1.6.0
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2
github.com/dolthub/go-mysql-server v0.16.1-0.20230725191100-b5891a70d94a
github.com/dolthub/go-mysql-server v0.16.1-0.20230726215023-ca0b602ba632
github.com/dolthub/swiss v0.1.0
github.com/goccy/go-json v0.10.2
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
Expand Down
4 changes: 2 additions & 2 deletions go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ github.com/dolthub/fslock v0.0.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U=
github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0=
github.com/dolthub/go-icu-regex v0.0.0-20230524105445-af7e7991c97e h1:kPsT4a47cw1+y/N5SSCkma7FhAPw7KeGmD6c9PBZW9Y=
github.com/dolthub/go-icu-regex v0.0.0-20230524105445-af7e7991c97e/go.mod h1:KPUcpx070QOfJK1gNe0zx4pA5sicIK1GMikIGLKC168=
github.com/dolthub/go-mysql-server v0.16.1-0.20230725191100-b5891a70d94a h1:6swKWvtykzkKBBEUDFLenQH/YMwc7gXGNjymYStsS4Y=
github.com/dolthub/go-mysql-server v0.16.1-0.20230725191100-b5891a70d94a/go.mod h1:HNJKWMlO3657iU4+lnAmXoZNXu4BrKR7LC/cw+IE4QM=
github.com/dolthub/go-mysql-server v0.16.1-0.20230726215023-ca0b602ba632 h1:5gheD0zd9dqHWzy4kvdNT99E0z1QYXXE99t4EFoPwNQ=
github.com/dolthub/go-mysql-server v0.16.1-0.20230726215023-ca0b602ba632/go.mod h1:HNJKWMlO3657iU4+lnAmXoZNXu4BrKR7LC/cw+IE4QM=
github.com/dolthub/ishell v0.0.0-20221214210346-d7db0b066488 h1:0HHu0GWJH0N6a6keStrHhUAK5/o9LVfkh44pvsV4514=
github.com/dolthub/ishell v0.0.0-20221214210346-d7db0b066488/go.mod h1:ehexgi1mPxRTk0Mok/pADALuHbvATulTh6gzr7NzZto=
github.com/dolthub/jsonpath v0.0.2-0.20230525180605-8dc13778fd72 h1:NfWmngMi1CYUWU4Ix8wM+USEhjc+mhPlT9JUR/anvbQ=
Expand Down
14 changes: 12 additions & 2 deletions go/libraries/doltcore/doltdb/system_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,26 @@ func HasDoltPrefix(s string) bool {
return strings.HasPrefix(strings.ToLower(s), DoltNamespace)
}

// IsFullTextTable returns a boolean stating whether the given table is one of the pseudo-index tables used by Full-Text
// indexes.
func IsFullTextTable(name string) bool {
return HasDoltPrefix(name) && (strings.HasSuffix(name, "_fts_config") ||
strings.HasSuffix(name, "_fts_position") ||
strings.HasSuffix(name, "_fts_doc_count") ||
strings.HasSuffix(name, "_fts_global_count") ||
strings.HasSuffix(name, "_fts_row_count"))
}

// IsReadOnlySystemTable returns whether the table name given is a system table that should not be included in command line
// output (e.g. dolt status) by default.
func IsReadOnlySystemTable(name string) bool {
return HasDoltPrefix(name) && !set.NewStrSet(writeableSystemTables).Contains(name)
return HasDoltPrefix(name) && !set.NewStrSet(writeableSystemTables).Contains(name) && !IsFullTextTable(name)
}

// IsNonAlterableSystemTable returns whether the table name given is a system table that cannot be dropped or altered
// by the user.
func IsNonAlterableSystemTable(name string) bool {
return IsReadOnlySystemTable(name) || strings.ToLower(name) == SchemasTableName
return (IsReadOnlySystemTable(name) && !IsFullTextTable(name)) || strings.ToLower(name) == SchemasTableName
}

// GetNonSystemTableNames gets non-system table names
Expand Down
Loading

0 comments on commit 0dd97f6

Please sign in to comment.