Skip to content

Commit

Permalink
/go/libraries/doltcore/{doltdb,sqle}: wip, figuring out foreign key junk
Browse files Browse the repository at this point in the history
  • Loading branch information
coffeegoddd committed Oct 18, 2024
1 parent 50e7254 commit 93afc19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions go/libraries/doltcore/doltdb/system_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ func IsFullTextTable(name string) bool {
strings.HasSuffix(name, "_fts_row_count"))
}

// IsDoltCITable returns whether the table name given is a dolt-ci table
func IsDoltCITable(name string) bool {
return HasDoltPrefix(name) && set.NewStrSet(writeableSystemTables).Contains(name) && !IsFullTextTable(name)
}

// 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 {
Expand Down
2 changes: 2 additions & 0 deletions go/libraries/doltcore/sqle/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,8 @@ func (db Database) newDoltTable(tableName string, sch schema.Schema, tbl *doltdb
var table sql.Table
if doltdb.IsReadOnlySystemTable(tableName) {
table = readonlyTable
} else if doltdb.IsDoltCITable(tableName) {
table = &AlterableDoltTable{WritableDoltTable{DoltTable: readonlyTable, db: db}}
} else if doltdb.HasDoltPrefix(tableName) && !doltdb.IsFullTextTable(tableName) {
table = &WritableDoltTable{DoltTable: readonlyTable, db: db}
} else {
Expand Down

0 comments on commit 93afc19

Please sign in to comment.