import NoteContextAwareWidget from "./note_context_aware_widget.js"; import treeService from "../services/tree.js"; import linkService from "../services/link.js"; import hoistedNoteService from "../services/hoisted_note.js"; import server from "../services/server.js"; import toastService from "../services/toast.js"; const TPL = `
`; export default class SqlTableSchemasWidget extends NoteContextAwareWidget { isEnabled() { return this.note && this.note.mime === 'text/x-sqlite;schema=trilium' && super.isEnabled(); } doRender() { this.$widget = $(TPL); this.overflowing(); this.$sqlConsoleTableSchemas = this.$widget.find('.sql-table-schemas'); } async refreshWithNote(note) { if (this.tableSchemasShown) { return; } this.tableSchemasShown = true; const tableSchema = await server.get('sql/schema'); for (const table of tableSchema) { const $tableLink = $('