chore(sqllab): Remove table metadata from state (#24371)

This commit is contained in:
JUST.in DO IT
2023-06-22 15:37:03 -07:00
committed by GitHub
parent 2a4ef5cccf
commit 51a34d7d58
14 changed files with 515 additions and 410 deletions

View File

@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import pick from 'lodash/pick';
import {
BYTES_PER_CHAR,
KB_STORAGE,
@@ -50,6 +51,21 @@ function shouldEmptyQueryResults(query) {
);
}
export function emptyTablePersistData(tables) {
return tables
.map(table =>
pick(table, [
'id',
'name',
'dbId',
'schema',
'dataPreviewQueryId',
'queryEditorId',
]),
)
.filter(({ queryEditorId }) => Boolean(queryEditorId));
}
export function emptyQueryResults(queries) {
return Object.keys(queries).reduce((accu, key) => {
const { results } = queries[key];