Folders: Introduce folder service function for fetching folders by org and UIDs that contain optionally the folder full path (#80716)
* Folders: Expose function for getting all org folders with specific UIDs * Return all org folders if UIDs is empty * Filter out not accessible folders by the user * Modify query to optionally returning a string that contains the UIDs of all parent folders separated by slash.
This commit is contained in:
@@ -91,6 +91,10 @@ type Dialect interface {
|
||||
// column names to values to use in the where clause.
|
||||
// The update is executed as part of the provided session.
|
||||
Update(ctx context.Context, tx *session.SessionTx, tableName string, row map[string]any, where map[string]any) error
|
||||
// Concat returns the sql statement for concating multiple strings
|
||||
// Implementations are not expected to quote the arguments
|
||||
// therefore any callers should take care to quote arguments as necessary
|
||||
Concat(...string) string
|
||||
}
|
||||
|
||||
type LockCfg struct {
|
||||
@@ -450,3 +454,7 @@ func (b *BaseDialect) Update(ctx context.Context, tx *session.SessionTx, tableNa
|
||||
_, err = tx.Exec(ctx, query, args...)
|
||||
return err
|
||||
}
|
||||
|
||||
func (b *BaseDialect) Concat(strs ...string) string {
|
||||
return fmt.Sprintf("CONCAT(%s)", strings.Join(strs, ", "))
|
||||
}
|
||||
|
||||
@@ -209,3 +209,7 @@ func (db *SQLite3) UpsertMultipleSQL(tableName string, keyCols, updateCols []str
|
||||
)
|
||||
return s, nil
|
||||
}
|
||||
|
||||
func (db *SQLite3) Concat(strs ...string) string {
|
||||
return strings.Join(strs, " || ")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user