LCOV - code coverage report
Current view: top level - dashql-app/src/storage/migration/session - v9_drop_session_settings.ts Coverage Total Hit
Test: DashQL 915828b Lines: 100.0 % 10 10
Test Date: 2026-11-06 19:30:32

            Line data    Source code
       1              : import type { SessionMigrationStep } from '../session_migration.js';
       2              : 
       3              : /// Connections decide whether query results are cached, sessions have no settings.
       4              : ///
       5              : /// Version 8 kept `settings.cacheQueryResults` in the session file, its only setting. The connections of the app
       6              : /// manifest hold the setting now, the step removes the settings of the session.
       7              : export const dropSessionSettings: SessionMigrationStep = {
       8            1 :     version: 9,
       9            1 :     description: 'Remove the settings of the session, connections decide whether query results are cached',
      10            1 :     async migrate(folder) {
      11            1 :         const text = await folder.readText('dashql-session.json');
      12            1 :         if (text == null) return;
      13            1 :         const data = JSON.parse(text) as Record<string, unknown>;
      14            1 :         if (!('settings' in data)) return;
      15            1 :         delete data.settings;
      16            1 :         await folder.writeText('dashql-session.json', JSON.stringify(data, null, 2));
      17            1 :     },
      18              : };
        

Generated by: LCOV version 2.0-1