SQL notebooks with Markdown cells and saved results

未关闭
#3,618 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
macos, markdown, sql, swift
领域
databases, desktop

调研方向

Read features/query-results.mdx, features/sql-files.mdx, and features/query-parameters.mdx to understand the existing query, file, and parameter behavior. The issue defines the target as a Markdown notebook with three SQL cells, two Markdown cells, saved results, and ordered execution that stops at the first error. No implementation files or tests are named, so the first step is locating the notebook and query execution entry points.

由索引模型根据 Issue 内容生成。

描述

enhancement platform-macos
Problem

A query tab holds SQL text and a set of results. Each statement can run on its own from the gutter (#2278), every run gets its own result, and pinning keeps one while you try another (features/query-results.mdx:8-40). Two things are missing:

  • Results are not kept. Saving a tab writes its SQL to the .sql file and nothing else (features/sql-files.mdx:18-26), so reopening an investigation means running every query again.
  • Notes live in SQL comments. Nothing renders Markdown between queries.

An incident write-up, a runbook or a weekly report that mixes queries, explanations and results gets rebuilt by hand each time, or pasted cell by cell into another document with Copy as Markdown (features/data-grid.mdx:166). #2278 set real notebook cells aside as a separate document model and product decision; this issue is that decision.

Proposed solution
  • A notebook is a Markdown file. Each fenced sql block is a SQL cell and the text between blocks is a Markdown cell, so a notebook diffs cleanly in Git and reads on GitHub.
  • Each SQL cell shows its result grid, or its chart, beneath it, using the existing grid and row cap. Cmd+Enter runs the cell; Run All and Run From Here run in order and stop at the first error.
  • A notebook runs on one connection, database and schema, shown in its header. :name query parameters set once at the top apply to every cell (features/query-parameters.mdx).
  • Save Results writes each cell's result below it as a Markdown table, capped at 100 rows, so a shared notebook shows what it showed. Clear Results removes them before a commit.
  • Export to HTML and PDF.
  • Notebooks open from Finder and Cmd+O, and linked SQL folders list them beside .sql files.
  • Safe Mode and the connection's policies apply to every cell as they do to a query tab.

Done when: a notebook with three SQL cells and two Markdown cells saves, reopens with its results, renders on GitHub, and Run All stops at a failing second cell without running the third.

Alternatives considered

Keep the queries in a .sql file and the notes and pasted results in a separate document.

Platform

macOS

Related database type

N/A / General

主要语言
Swift
星标
6.2k
派生
412
平均合并
3 小时 56 分钟
30 天内合并 PR
669

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TableProApp/TablePro 的其他 Issue

查看 TableProApp/TablePro 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。