Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class GetConnectionDiagramUseCase
: undefined;

await validateSchemaCache(dao, userEmail);
dao.invalidateMetadataCache();

let tables: Array<{ tableName: string; isView: boolean }>;
try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Knex } from 'knex';
import { LRUStorage } from '../../caching/lru-storage.js';
import { isObjectEmpty } from '../../helpers/is-object-empty.js';
import { KnexManager } from '../../knex-manager/knex-manager.js';
import { ConnectionParams } from '../shared/data-structures/connections-params.ds.js';
Expand All @@ -11,6 +12,11 @@ export class BasicDataAccessObject {
constructor(connection: ConnectionParams) {
this.connection = connection;
}

public invalidateMetadataCache(): void {
LRUStorage.invalidateConnectionTableMetadata(this.connection);
}

protected async configureKnex(): Promise<Knex<any, any[]>> {
const knexManager = KnexManager.knexStorage();
return knexManager.get(this.connection.type)(this.connection);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ export class DataAccessObjectAgent implements IDataAccessObjectAgent {
this.connection = connection;
}

public invalidateMetadataCache(): void {
LRUStorage.invalidateConnectionTableMetadata(this.connection);
}

public async addRowInTable(
tableName: string,
row: Record<string, unknown>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ export interface IDataAccessObjectAgent {

getTableStructureWithoutCache(tableName: string, userEmail: string): Promise<Array<TableStructureDS>>;

invalidateMetadataCache(): void;

testConnect(): Promise<TestConnectionResultDS>;

updateRowInTable(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export interface IDataAccessObject {

getTableStructureWithoutCache(tableName: string): Promise<Array<TableStructureDS>>;

invalidateMetadataCache(): void;

testConnect(): Promise<TestConnectionResultDS>;

updateRowInTable(
Expand Down
Loading