From b7570e17f71ce52005ff09e3dff325a7c48cf958 Mon Sep 17 00:00:00 2001 From: emrberk Date: Thu, 9 Oct 2025 02:00:08 +0300 Subject: [PATCH 1/5] Add ToC and compact reference creation for AI Assistant, improve raw-markdown conversions --- .../workflows/component-converter-check.yml | 32 ++ .gitignore | 2 + documentation/reference/function/date-time.md | 1 - .../sql/alter-table-alter-column-add-index.md | 4 +- .../sql/alter-table-alter-column-cache.md | 3 +- .../reference/sql/alter-table-resume-wal.md | 2 +- documentation/reference/sql/reindex.md | 2 +- documentation/reference/sql/where.md | 22 - package.json | 2 +- plugins/raw-markdown/convert-components.js | 268 +++++++++++- plugins/raw-markdown/index.js | 70 +--- scripts/generate-reference-full.js | 178 ++++++++ scripts/generate-web-console-json.js | 217 ++++++++++ static/images/docs/diagrams/.railroad | 130 ++---- .../docs/diagrams/aAsofLtSpliceJoin.svg | 82 ---- static/images/docs/diagrams/addColumn.svg | 58 --- static/images/docs/diagrams/addIndex.svg | 50 --- .../docs/diagrams/alterTableAddIndex.svg | 59 ++- .../diagrams/alterTableAttachPartition.svg | 59 ++- .../diagrams/alterTableDetachPartition.svg | 101 ++++- .../docs/diagrams/alterTableDropColumn.svg | 51 ++- .../docs/diagrams/alterTableDropPartition.svg | 51 ++- .../docs/diagrams/alterTableNoCache.svg | 59 ++- .../docs/diagrams/alterTableRenameColumn.svg | 50 ++- .../docs/diagrams/alterTableResumeWal.svg | 52 --- .../docs/diagrams/alterTableSetParam.svg | 51 ++- .../diagrams/alterTableSetParamCommitLag.svg | 74 +++- .../diagrams/alterTableSquashPartitions.svg | 48 ++- .../docs/diagrams/assignServiceAccount.svg | 55 --- .../images/docs/diagrams/attachPartition.svg | 58 --- static/images/docs/diagrams/backup.svg | 53 --- static/images/docs/diagrams/booleanWhere.svg | 44 -- static/images/docs/diagrams/columnTypeDef.svg | 98 ++++- static/images/docs/diagrams/complexWhere.svg | 56 --- static/images/docs/diagrams/createTable.svg | 386 ------------------ .../images/docs/diagrams/createTableDef.svg | 279 +++++++------ .../docs/diagrams/createTableTimestamp.svg | 52 --- .../diagrams/createTableWithCommitParam.svg | 1 - .../diagrams/createTableWithCommitParams.svg | 73 ---- .../diagrams/createTableWithMaxRowParam.svg | 48 ++- .../diagrams/createTableWithMaxRowParams.svg | 47 --- static/images/docs/diagrams/declare.svg | 104 ++--- .../images/docs/diagrams/detachPartition.svg | 100 ----- static/images/docs/diagrams/dropColumn.svg | 50 --- static/images/docs/diagrams/dropPartition.svg | 50 --- .../diagrams/exactStringOrSymbolSearch.svg | 52 --- static/images/docs/diagrams/fromTo.svg | 101 ++--- static/images/docs/diagrams/grantAssume.svg | 64 --- .../diagrams/grantAssumeServiceAccount.svg | 88 ++-- .../diagrams/influxLineProtocolOverTCP.svg | 78 ---- ...influxLineProtocolOverTCPLoadRebalance.svg | 70 ---- .../influxLineProtocolTCPLoadBalancing.svg | 1 - .../influxLineProtocolTCPStructure.svg | 1 - .../images/docs/diagrams/inlineIndexDef.svg | 41 -- static/images/docs/diagrams/insert.svg | 261 ++++-------- .../images/docs/diagrams/insertCommitLag.svg | 1 - .../docs/diagrams/insertCommitLagInto.svg | 108 ----- static/images/docs/diagrams/insertInto.svg | 88 ---- static/images/docs/diagrams/latestBy.svg | 74 ---- .../docs/diagrams/latestByDeprecated.svg | 60 --- static/images/docs/diagrams/latestOn.svg | 75 +++- static/images/docs/diagrams/listMatch.svg | 58 --- static/images/docs/diagrams/noCacheColumn.svg | 58 --- static/images/docs/diagrams/regexMatch.svg | 55 --- static/images/docs/diagrams/reindex.svg | 1 - static/images/docs/diagrams/renameColumn.svg | 49 --- static/images/docs/diagrams/revokeAssume.svg | 55 --- .../diagrams/revokeAssumeServiceAccount.svg | 70 ++-- static/images/docs/diagrams/select.svg | 74 +++- static/images/docs/diagrams/setParam.svg | 50 --- .../docs/diagrams/setParamCommitLag.svg | 73 ---- static/images/docs/diagrams/snapshot.svg | 49 ++- .../images/docs/diagrams/squashPartitions.svg | 47 --- static/images/docs/diagrams/timestamp.svg | 53 ++- .../images/docs/diagrams/timestampExact.svg | 46 --- .../docs/diagrams/timestampExplicitRange.svg | 57 --- .../docs/diagrams/timestampInSearch.svg | 59 --- .../docs/diagrams/timestampIntervalSearch.svg | 103 ----- .../images/docs/diagrams/timestampPartial.svg | 62 --- .../images/docs/diagrams/timestampSearch.svg | 64 --- static/images/docs/diagrams/typeDef.svg | 97 ----- .../docs/diagrams/unassignServiceAccount.svg | 55 --- static/images/docs/diagrams/update.svg | 70 ++-- static/images/docs/diagrams/where.svg | 52 ++- static/images/docs/diagrams/whereBoolean.svg | 45 +- static/images/docs/diagrams/whereComplex.svg | 57 ++- .../docs/diagrams/whereEqDoublePrecision.svg | 1 - .../whereEqDoubleProximityPrecision.svg | 60 --- .../images/docs/diagrams/whereExactString.svg | 53 ++- static/images/docs/diagrams/whereListIn.svg | 59 ++- .../images/docs/diagrams/whereRegexMatch.svg | 47 ++- .../docs/diagrams/whereRegexNotMatch.svg | 56 ++- .../docs/diagrams/whereStringNotMatch.svg | 53 ++- .../docs/diagrams/whereTimestampExact.svg | 47 ++- .../diagrams/whereTimestampIntervalSearch.svg | 104 ++++- .../docs/diagrams/whereTimestampPartial.svg | 63 ++- .../docs/diagrams/whereTimestampRange.svg | 1 - .../images/docs/diagrams/windowFunction.svg | 141 ------- static/images/docs/diagrams/withAsInsert.svg | 228 +++-------- .../docs/diagrams/withAsInsertCommitLag.svg | 99 ----- 100 files changed, 2852 insertions(+), 4114 deletions(-) create mode 100644 .github/workflows/component-converter-check.yml create mode 100644 scripts/generate-reference-full.js create mode 100644 scripts/generate-web-console-json.js delete mode 100644 static/images/docs/diagrams/aAsofLtSpliceJoin.svg delete mode 100644 static/images/docs/diagrams/addColumn.svg delete mode 100644 static/images/docs/diagrams/addIndex.svg delete mode 100644 static/images/docs/diagrams/alterTableResumeWal.svg delete mode 100644 static/images/docs/diagrams/assignServiceAccount.svg delete mode 100644 static/images/docs/diagrams/attachPartition.svg delete mode 100644 static/images/docs/diagrams/backup.svg delete mode 100644 static/images/docs/diagrams/booleanWhere.svg delete mode 100644 static/images/docs/diagrams/complexWhere.svg delete mode 100644 static/images/docs/diagrams/createTable.svg delete mode 100644 static/images/docs/diagrams/createTableTimestamp.svg delete mode 100644 static/images/docs/diagrams/createTableWithCommitParam.svg delete mode 100644 static/images/docs/diagrams/createTableWithCommitParams.svg delete mode 100644 static/images/docs/diagrams/createTableWithMaxRowParams.svg delete mode 100644 static/images/docs/diagrams/detachPartition.svg delete mode 100644 static/images/docs/diagrams/dropColumn.svg delete mode 100644 static/images/docs/diagrams/dropPartition.svg delete mode 100644 static/images/docs/diagrams/exactStringOrSymbolSearch.svg delete mode 100644 static/images/docs/diagrams/grantAssume.svg delete mode 100644 static/images/docs/diagrams/influxLineProtocolOverTCP.svg delete mode 100644 static/images/docs/diagrams/influxLineProtocolOverTCPLoadRebalance.svg delete mode 100644 static/images/docs/diagrams/influxLineProtocolTCPLoadBalancing.svg delete mode 100644 static/images/docs/diagrams/influxLineProtocolTCPStructure.svg delete mode 100644 static/images/docs/diagrams/inlineIndexDef.svg delete mode 100644 static/images/docs/diagrams/insertCommitLag.svg delete mode 100644 static/images/docs/diagrams/insertCommitLagInto.svg delete mode 100644 static/images/docs/diagrams/insertInto.svg delete mode 100644 static/images/docs/diagrams/latestBy.svg delete mode 100644 static/images/docs/diagrams/latestByDeprecated.svg delete mode 100644 static/images/docs/diagrams/listMatch.svg delete mode 100644 static/images/docs/diagrams/noCacheColumn.svg delete mode 100644 static/images/docs/diagrams/regexMatch.svg delete mode 100644 static/images/docs/diagrams/reindex.svg delete mode 100644 static/images/docs/diagrams/renameColumn.svg delete mode 100644 static/images/docs/diagrams/revokeAssume.svg delete mode 100644 static/images/docs/diagrams/setParam.svg delete mode 100644 static/images/docs/diagrams/setParamCommitLag.svg delete mode 100644 static/images/docs/diagrams/squashPartitions.svg delete mode 100644 static/images/docs/diagrams/timestampExact.svg delete mode 100644 static/images/docs/diagrams/timestampExplicitRange.svg delete mode 100644 static/images/docs/diagrams/timestampInSearch.svg delete mode 100644 static/images/docs/diagrams/timestampIntervalSearch.svg delete mode 100644 static/images/docs/diagrams/timestampPartial.svg delete mode 100644 static/images/docs/diagrams/timestampSearch.svg delete mode 100644 static/images/docs/diagrams/typeDef.svg delete mode 100644 static/images/docs/diagrams/unassignServiceAccount.svg delete mode 100644 static/images/docs/diagrams/whereEqDoublePrecision.svg delete mode 100644 static/images/docs/diagrams/whereEqDoubleProximityPrecision.svg delete mode 100644 static/images/docs/diagrams/whereTimestampRange.svg delete mode 100644 static/images/docs/diagrams/windowFunction.svg delete mode 100644 static/images/docs/diagrams/withAsInsertCommitLag.svg diff --git a/.github/workflows/component-converter-check.yml b/.github/workflows/component-converter-check.yml new file mode 100644 index 000000000..3ab8a5b41 --- /dev/null +++ b/.github/workflows/component-converter-check.yml @@ -0,0 +1,32 @@ +name: Component Converter Check + +on: + pull_request: + paths: + - "src/components/**" + - "src/theme/**" + +jobs: + check-converters: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Comment on PR about converter check + uses: thollander/actions-comment-pull-request@v2 + with: + message: | + ## 🤖 Component Converter Reminder + + A component in `src/components/` or `src/theme/` was modified in this pull request. + + We are creating markdown correspondents of every path (e.g. questdb.com/docs/quick-start → questdb.com/docs/quick-start/index.md) for LLM consumption. + If the component usage is shadowing useful content, it may need a converter for markdown output in `convert-components.js`. + + ### Quick Check + - ✅ **Content component** (code, tables, data) → Add converter if not exists + - ❌ **UI/visual component** (styling, buttons, decorative) → No converter needed + + --- + 💡 *This is a friendly reminder, not a blocker. Ignore if not applicable.* + comment_tag: component-converter-check diff --git a/.gitignore b/.gitignore index 6529ac36c..f0f519552 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,8 @@ plugins/*/compiled .netlify .cache-loader static/llms.txt +static/reference-full.md +static/web-console/*.json # Misc .DS_Store diff --git a/documentation/reference/function/date-time.md b/documentation/reference/function/date-time.md index 5e8b560da..7425ead8a 100644 --- a/documentation/reference/function/date-time.md +++ b/documentation/reference/function/date-time.md @@ -116,7 +116,6 @@ reference. --- -# Function Reference ## date_trunc diff --git a/documentation/reference/sql/alter-table-alter-column-add-index.md b/documentation/reference/sql/alter-table-alter-column-add-index.md index eced42179..d940bbdc5 100644 --- a/documentation/reference/sql/alter-table-alter-column-add-index.md +++ b/documentation/reference/sql/alter-table-alter-column-add-index.md @@ -8,8 +8,8 @@ Indexes an existing [`symbol`](/docs/concept/symbol/) column. ## Syntax -![Flow chart showing the syntax of the ALTER TABLE keyword](/images/docs/diagrams/alterTable.svg) -![Flow chart showing the syntax of the ALTER TABLE with ADD INDEX keyword](/images/docs/diagrams/alterTableAddIndex.svg) +![Flow chart showing the syntax of the ALTER TABLE ALTER COLUMN ADD INDEX keyword](/images/docs/diagrams/alterTableAddIndex.svg) + Adding an [index](/docs/concept/indexes/) is an atomic, non-blocking, and non-waiting operation. Once complete, the SQL optimizer will start using the new diff --git a/documentation/reference/sql/alter-table-alter-column-cache.md b/documentation/reference/sql/alter-table-alter-column-cache.md index df90b64ce..969286bf7 100644 --- a/documentation/reference/sql/alter-table-alter-column-cache.md +++ b/documentation/reference/sql/alter-table-alter-column-cache.md @@ -8,8 +8,7 @@ sidebar_label: CACHE | NOCACHE ## Syntax -![Flow chart showing the syntax of the ALTER TABLE keyword](/images/docs/diagrams/alterTable.svg) -![Flow chart showing the syntax of NOCACHE | CACHE](/images/docs/diagrams/alterTableNoCache.svg) +![Flow chart showing the syntax of ALTER TABLE ALTER COLUMN NOCACHE | CACHE](/images/docs/diagrams/alterTableNoCache.svg) - `columnName` is the `symbol` data type. - By default, a symbol column is cached. diff --git a/documentation/reference/sql/alter-table-resume-wal.md b/documentation/reference/sql/alter-table-resume-wal.md index 5659bb890..3c7121ea7 100644 --- a/documentation/reference/sql/alter-table-resume-wal.md +++ b/documentation/reference/sql/alter-table-resume-wal.md @@ -10,7 +10,7 @@ recovery from errors. ## Syntax ![Flow chart showing the syntax of the ALTER TABLE keyword](/images/docs/diagrams/alterTable.svg) -![Flow chart showing the syntax of ALTER TABLE with RESUME WAL keyword](/images/docs/diagrams/alterTableResumeWal.svg) +![Flow chart showing the syntax of ALTER TABLE with RESUME WAL keyword](/images/docs/diagrams/resumeWal.svg) ## Description diff --git a/documentation/reference/sql/reindex.md b/documentation/reference/sql/reindex.md index 9e6304b4a..00cde0364 100644 --- a/documentation/reference/sql/reindex.md +++ b/documentation/reference/sql/reindex.md @@ -14,7 +14,7 @@ write should be performed on the selected table. ## Syntax -![Flow chart showing the syntax of the REINDEX keyword](/images/docs/diagrams/reindex.svg) +![Flow chart showing the syntax of the REINDEX keyword](/images/docs/diagrams/reindexTable.svg) ## Options diff --git a/documentation/reference/sql/where.md b/documentation/reference/sql/where.md index 8add1a8fe..69a5c568a 100644 --- a/documentation/reference/sql/where.md +++ b/documentation/reference/sql/where.md @@ -160,28 +160,6 @@ SELECT * FROM users WHERE age = 23; SELECT * FROM users WHERE age != 23; ``` - - ## Boolean ![Flow chart showing the syntax of the WHERE clause with a boolean comparison](/images/docs/diagrams/whereBoolean.svg) diff --git a/package.json b/package.json index 40e728005..626ecf082 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "scripts": { "start": "cross-env docusaurus start --port 3001", - "prebuild": "docusaurus clear && node ./scripts/generate-llms-files.js", + "prebuild": "docusaurus clear && node ./scripts/generate-llms-files.js && node ./scripts/generate-reference-full.js && node ./scripts/generate-web-console-json.js", "build": "cross-env NO_UPDATE_NOTIFIER=true USE_SIMPLE_CSS_MINIFIER=true PWA_SW_CUSTOM= docusaurus build", "deploy": "docusaurus deploy", "serve": "docusaurus serve", diff --git a/plugins/raw-markdown/convert-components.js b/plugins/raw-markdown/convert-components.js index a1f4f3dbd..7c741d1fe 100644 --- a/plugins/raw-markdown/convert-components.js +++ b/plugins/raw-markdown/convert-components.js @@ -84,7 +84,7 @@ function convertTabs(content) { const valuesStr = valuesMatch[1] .replace(/'/g, '"') // Replace single quotes with double quotes .replace(/,(\s*[}\]])/g, '$1') // Remove trailing commas before } or ] - .replace(/(\w+):/g, '"$1":') // Quote unquoted keys + .replace(/([\[{,]\s*)(\w+):/g, '$1"$2":') // Quote unquoted keys (only after [, {, or ,) valuesArray = JSON.parse(valuesStr) } catch (e) { console.warn("[convert-components] Failed to parse Tabs values:", e.message) @@ -158,14 +158,14 @@ function convertConfigTable(content, docsPath) { for (const item of configData) { const property = item.property || item.name || "" const type = item.type || "" - const description = (item.description || "").replace(/\n/g, " ") + const description = (item.description || "").replace(/\n/g, " ").replace(/\|/g, "\\|") table += `| ${property} | ${type} | ${description} |\n` } } else if (typeof configData === 'object') { // Handle object format where keys are property names for (const [property, config] of Object.entries(configData)) { const type = config.default || config.type || "" - const description = (config.description || "").replace(/\n/g, " ") + const description = (config.description || "").replace(/\n/g, " ").replace(/\|/g, "\\|") table += `| ${property} | ${type} | ${description} |\n` } } @@ -294,19 +294,135 @@ function convertRailroadDiagrams(content, docsPath) { if (definition) { return `\n\n\`\`\`railroad\n${definition}\n\`\`\`\n\n` } + console.warn(`[convert-components] Railroad diagram not found in .railroad file: ${diagramName}`) // If not found, remove the image reference return '\n\n' }) } +/** + * Converts to markdown code block with actual code + * @param {string} content - The markdown content + * @param {object} repoExamples - Repository examples data from remote-repo-example plugin + */ +function convertRemoteRepoExample(content, repoExamples = {}) { + // Use [\s\S]*? to match across multiple lines + const remoteRepoRegex = //g + + return content.replace(remoteRepoRegex, (match, propsString) => { + const props = parseProps(propsString) + const name = props.name || 'unknown' + const lang = props.lang || 'text' + const id = `${name}/${lang}` + + // Get the example from plugin data + const example = repoExamples[id] + + if (!example || !example.code) { + // Fallback if example not found + return `\n\n\`\`\`${lang}\n// Code example: ${name} in ${lang}\n// (Example not found in repository data)\n\`\`\`\n\n` + } + + // Build markdown output + let output = '\n\n' + + // Add header if it exists and header prop is not false + if (props.header !== 'false' && example.header) { + output += `${example.header}\n\n` + } + + // Add code block + output += `\`\`\`${lang}\n${example.code}\n\`\`\`\n\n` + + return output + }) +} + +/** + * Converts to markdown list with links + */ +const clients = [ + { + label: "Python", + docsUrl: "https://py-questdb-client.readthedocs.io/en/latest/", + sourceUrl: "https://github.com/questdb/py-questdb-client", + }, + { + label: "NodeJS", + docsUrl: "https://questdb.github.io/nodejs-questdb-client", + sourceUrl: "https://github.com/questdb/nodejs-questdb-client", + }, + { + label: ".NET", + sourceUrl: "https://github.com/questdb/net-questdb-client", + }, + { + label: "Java", + docsUrl: "/docs/reference/clients/java_ilp/", + }, + { + label: "C", + docsUrl: "https://github.com/questdb/c-questdb-client/blob/main/doc/C.md", + sourceUrl: "https://github.com/questdb/c-questdb-client", + }, + { + label: "C++", + docsUrl: "https://github.com/questdb/c-questdb-client/blob/main/doc/CPP.md", + sourceUrl: "https://github.com/questdb/c-questdb-client", + }, + { + label: "Golang", + docsUrl: "https://pkg.go.dev/github.com/questdb/go-questdb-client/", + sourceUrl: "https://github.com/questdb/go-questdb-client/", + }, + { + label: "Rust", + docsUrl: "https://docs.rs/crate/questdb-rs/latest", + sourceUrl: "https://github.com/questdb/c-questdb-client", + }, +] +function convertILPClientsTable(content) { + // Use [\s\S]*? to match across multiple lines + const ilpClientsRegex = //g + + return content.replace(ilpClientsRegex, (match, propsString) => { + const props = parseProps(propsString) + const language = props.language + + // Filter by language if specified + const filteredClients = language + ? clients.filter(c => c.label === language) + : clients + + // Build markdown list + let markdown = '\n\n' + + for (const client of filteredClients.sort((a, b) => a.label.localeCompare(b.label))) { + markdown += `**${client.label} Client**\n\n` + + if (client.docsUrl) { + markdown += `- [View full docs](${client.docsUrl})\n` + } + if (client.sourceUrl) { + markdown += `- [View source code](${client.sourceUrl})\n` + } + + markdown += '\n' + } + + return markdown + }) +} + /** * Main function to convert all components in content * @param {string} content - The markdown content * @param {string} currentFileDir - Directory of the current file (for resolving imports) * @param {string} docsRoot - Root documentation directory (for railroad diagrams) + * @param {object} repoExamples - Repository examples data (optional) */ -async function convertAllComponents(content, currentFileDir, docsRoot) { +async function convertAllComponents(content, currentFileDir, docsRoot, repoExamples = {}) { let processed = content // Get release version once @@ -314,6 +430,8 @@ async function convertAllComponents(content, currentFileDir, docsRoot) { // Convert components in order processed = convertInterpolateReleaseData(processed, releaseVersion) + processed = convertRemoteRepoExample(processed, repoExamples) + processed = convertILPClientsTable(processed) processed = convertScreenshot(processed) processed = convertDocButton(processed) processed = convertCodeBlock(processed) @@ -324,6 +442,143 @@ async function convertAllComponents(content, currentFileDir, docsRoot) { return processed } +/** + * Bumps markdown heading levels outside of code blocks + * @param {string} markdown - The markdown content + * @param {number} bumpBy - Number of levels to increase (default: 1) + * @returns {string} Markdown with adjusted heading levels + */ +function bumpHeadings(markdown, bumpBy = 1) { + const lines = markdown.split('\n') + let inFence = false + let fenceChar = '' + let fenceLen = 0 + + function isFence(line) { + // Match 3+ consecutive backticks OR 3+ consecutive tildes (not mixed) + const m = line.match(/^\s*(`{3,}|~{3,})(.*)$/) + if (!m) return null + return { ticks: m[1], info: m[2] } + } + + for (let i = 0; i < lines.length; i++) { + const line = lines[i] + + const fenceMatch = isFence(line) + if (fenceMatch) { + if (!inFence) { + inFence = true + fenceChar = fenceMatch.ticks[0] + fenceLen = fenceMatch.ticks.length + } else if (fenceMatch.ticks[0] === fenceChar && fenceMatch.ticks.length >= fenceLen) { + inFence = false + fenceChar = '' + fenceLen = 0 + } + continue + } + + if (inFence) continue + + // ATX heading outside code: optional leading spaces then 1-6 #'s and a space + const headingMatch = line.match(/^(\s{0,3})(#{1,6})\s+(.*)$/) + if (headingMatch) { + const leading = headingMatch[1] + const hashes = headingMatch[2] + const text = headingMatch[3] + const newLevel = Math.min(hashes.length + bumpBy, 6) + lines[i] = `${leading}${'#'.repeat(newLevel)} ${text}` + } + } + + return lines.join('\n') +} + +/** + * Removes import statements from processed markdown + * Handles both single-line and multi-line imports + * @param {string} content - The markdown content + * @returns {string} Content with imports removed + */ +function removeImports(content) { + let processed = content + // First handle single-line imports + processed = processed.replace(/^import\s+.+\s+from\s+['"].+['"];?\s*$/gm, '') + // Then handle multi-line imports (where line breaks exist) + processed = processed.replace(/^import\s+[\s\S]*?\s+from\s*\n?\s*['"].+['"];?\s*$/gm, '') + return processed +} + +/** + * Processes partial component imports + * Extracts import statements and replaces component usage with actual content + * @param {string} content - The markdown content + * @param {Function} loadPartialFn - Function to load partial content: (partialPath, currentFileDir) => string + * @param {string} currentFileDir - Relative directory of current file from docs root + * @returns {string} Content with partials expanded + */ +function processPartialImports(content, loadPartialFn, currentFileDir) { + // Extract import statements to build a map of component names to partial paths + const importMap = new Map() + // Match: import ComponentName from "path/to/file.partial.mdx" + const importRegex = /^import\s+(\w+)\s*\n?\s*from\s*['"](.+\.partial\.mdx?)['"];?\s*$/gm + let match + while ((match = importRegex.exec(content)) !== null) { + const componentName = match[1] + const partialPath = match[2] + importMap.set(componentName, partialPath) + } + + // Replace partial component references with their content + // Match or + let processed = content.replace(/<(\w+)\s*\/>/g, (fullMatch, componentName) => { + if (importMap.has(componentName)) { + const partialPath = importMap.get(componentName) + const partialContent = loadPartialFn(partialPath, currentFileDir) + // Add blank lines before and after the partial content + return `\n\n${partialContent}\n\n` + } + // If not a partial, keep the component reference + return fullMatch + }) + + return processed +} + +/** + * Prepends frontmatter title and description to content + * @param {string} content - The markdown content + * @param {Object} frontmatter - Frontmatter object with title and description + * @param {boolean} includeTitle - Whether to include title as H1 (default: true) + * @returns {string} Content with title and description prepended + */ +function prependFrontmatter(content, frontmatter, includeTitle = true) { + let processedContent = '' + + if (includeTitle && frontmatter.title) { + processedContent += `# ${frontmatter.title}\n\n` + } + + if (frontmatter.description) { + processedContent += `${frontmatter.description}\n\n` + } + + processedContent += content + return processedContent +} + +/** + * Cleans processed markdown for final output + * Normalizes whitespace + * @param {string} content - The processed markdown content + * @returns {string} Cleaned markdown + */ +function cleanForLLM(content) { + return content + .replace(/\n{3,}/g, '\n\n') // Normalize multiple newlines + .trim() +} + module.exports = { convertAllComponents, convertScreenshot, @@ -333,4 +588,9 @@ module.exports = { convertConfigTable, convertInterpolateReleaseData, fetchReleaseVersion, + bumpHeadings, + cleanForLLM, + removeImports, + processPartialImports, + prependFrontmatter, } diff --git a/plugins/raw-markdown/index.js b/plugins/raw-markdown/index.js index 8bbc32372..ad8d73f87 100644 --- a/plugins/raw-markdown/index.js +++ b/plugins/raw-markdown/index.js @@ -1,14 +1,24 @@ const fs = require("fs") const path = require("path") const matter = require("gray-matter") -const { convertAllComponents } = require("./convert-components") +const { + convertAllComponents, + removeImports, + processPartialImports, + prependFrontmatter, + cleanForLLM, +} = require("./convert-components") module.exports = () => ({ name: "raw-markdown", - async postBuild({ outDir }) { + async postBuild({ outDir, plugins }) { const docsPath = path.join(__dirname, "../../documentation") const outputBase = outDir + // Get remote repo example data from plugin + const remoteRepoPlugin = plugins.find(p => p.name === 'remote-repo-example') + const repoExamples = remoteRepoPlugin?.content || {} + const partialCache = new Map() let fileCount = 0 @@ -48,58 +58,22 @@ module.exports = () => ({ const content = fs.readFileSync(fullPath, "utf8") const { data: frontmatter, content: markdownContent } = matter(content) - let processedContent = "" + // Prepend title and description from frontmatter + let processedContent = prependFrontmatter(markdownContent, frontmatter, true) - if (frontmatter.title) { - processedContent += `# ${frontmatter.title}\n\n` - } - - if (frontmatter.description) { - processedContent += `${frontmatter.description}\n\n` - } - - processedContent += markdownContent - - // Extract import statements to build a map of component names to partial paths - const importMap = new Map() - // Match: import ComponentName from "path/to/file.partial.mdx" - // Note: \s* allows for no space before 'from' (handles from" without space) - const importRegex = /^import\s+(\w+)\s*\n?\s*from\s*['"](.+\.partial\.mdx?)['"];?\s*$/gm - let match - while ((match = importRegex.exec(processedContent)) !== null) { - const componentName = match[1] - const partialPath = match[2] - importMap.set(componentName, partialPath) - } - - // Replace partial component references with their content - // Match or - processedContent = processedContent.replace(/<(\w+)\s*\/>/g, (fullMatch, componentName) => { - if (importMap.has(componentName)) { - const partialPath = importMap.get(componentName) - const currentFileDir = path.dirname(relativePath) - const partialContent = loadPartial(partialPath, currentFileDir) - // Add blank lines before and after the partial content - return `\n\n${partialContent}\n\n` - } - // If not a partial, keep the component reference - return fullMatch - }) + // Process partial component imports + const currentFileRelativeDir = path.dirname(relativePath) + processedContent = processPartialImports(processedContent, loadPartial, currentFileRelativeDir) // Convert MDX components to markdown equivalents - // Pass both the current file's directory (for imports) and docs root (for railroad) const currentFileDir = path.join(docsPath, path.dirname(relativePath)) - processedContent = await convertAllComponents(processedContent, currentFileDir, docsPath) - - // First handle single-line imports - processedContent = processedContent.replace(/^import\s+.+\s+from\s+['"].+['"];?\s*$/gm, "") - // Then handle multi-line imports (where line breaks exist) - processedContent = processedContent.replace(/^import\s+[\s\S]*?\s+from\s*\n?\s*['"].+['"];?\s*$/gm, "") + processedContent = await convertAllComponents(processedContent, currentFileDir, docsPath, repoExamples) - // Remove multiple consecutive blank lines (leave max 2) - processedContent = processedContent.replace(/\n{3,}/g, "\n\n") + // Remove import statements + processedContent = removeImports(processedContent) - processedContent = processedContent.trim() + "\n" + // Clean and normalize + processedContent = cleanForLLM(processedContent) + "\n" let urlPath diff --git a/scripts/generate-reference-full.js b/scripts/generate-reference-full.js new file mode 100644 index 000000000..68538f14c --- /dev/null +++ b/scripts/generate-reference-full.js @@ -0,0 +1,178 @@ +const fs = require('fs') +const path = require('path') +const yaml = require('js-yaml') +const { + convertAllComponents, + bumpHeadings, + cleanForLLM, + removeImports, + processPartialImports, + prependFrontmatter, +} = require('../plugins/raw-markdown/convert-components') + +const ROOT_DIR = path.resolve(__dirname, '..') +const DOCS_DIR = path.join(ROOT_DIR, 'documentation') +const OUTPUT_DIR = path.join(ROOT_DIR, 'static') + +const SECTIONS = [ + { base: 'reference', dir: 'function', label: 'Functions' }, + { base: 'reference', dir: 'operators', label: 'Operators' }, + { base: 'reference', dir: 'sql', label: 'SQL' }, + { base: 'concept', dir: '', label: 'Concept' } +] + +function readFileIfExists(filePath) { + try { + if (fs.existsSync(filePath)) { + return fs.readFileSync(filePath, 'utf8') + } + } catch (_) { + console.warn(`[generate-reference-full] Warning: File not found: ${filePath}`) + } + return null +} + +// Partial cache shared across all files +const partialCache = new Map() + +function loadPartial(partialPath, currentFileDir) { + // Unescape markdown escaped characters (like \_ -> _) + const unescapedPath = partialPath.replace(/\\_/g, '_') + const absolutePath = path.resolve(path.join(DOCS_DIR, currentFileDir), unescapedPath) + + if (partialCache.has(absolutePath)) { + return partialCache.get(absolutePath) + } + + if (fs.existsSync(absolutePath)) { + const partialRaw = fs.readFileSync(absolutePath, 'utf8') + // Strip frontmatter from partial + const frontmatterRegex = /^---\s*\n[\s\S]*?\n---\s*\n([\s\S]*)$/ + const match = partialRaw.match(frontmatterRegex) + const content = match ? match[1] : partialRaw + partialCache.set(absolutePath, content) + return content + } + + console.warn(`[generate-reference-full] Warning: Partial not found: ${absolutePath}`) + return `` +} + +async function extractFrontmatterAndContent(raw, filePath) { + const frontmatterRegex = /^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/ + const match = raw.match(frontmatterRegex) + + let frontmatter = {} + let mainContent = raw + + if (match) { + try { + frontmatter = yaml.load(match[1]) || {} + } catch (_) {} + mainContent = match[2] + } + + // Prepend title and description (title will become H1, bumped to H2 later) + let processedContent = prependFrontmatter(mainContent, frontmatter, true) + + // Process partial component imports + const relativeDir = path.relative(DOCS_DIR, path.dirname(filePath)) + processedContent = processPartialImports(processedContent, loadPartial, relativeDir) + + // Convert MDX components to markdown + const currentFileDir = path.dirname(filePath) + const docsRoot = DOCS_DIR + processedContent = await convertAllComponents(processedContent, currentFileDir, docsRoot) + + // Remove import statements + processedContent = removeImports(processedContent) + + // Clean and normalize + processedContent = cleanForLLM(processedContent) + + // Bump heading levels for proper hierarchy in combined document + // H1 (title) becomes H2, H2 becomes H3, etc. + const cleanContent = bumpHeadings(processedContent, 1) + + return { + title: frontmatter.title || null, + description: frontmatter.description || null, + content: cleanContent + } +} + +function getAllMarkdownFilesRecursive(dirPath) { + const entries = fs.readdirSync(dirPath, { withFileTypes: true }) + const files = [] + + for (const entry of entries) { + const fullPath = path.join(dirPath, entry.name) + if (entry.isDirectory()) { + files.push(...getAllMarkdownFilesRecursive(fullPath)) + } else if (entry.isFile() && entry.name.endsWith('.md')) { + files.push(fullPath) + } + } + + files.sort((a, b) => a.localeCompare(b)) + return files +} + +async function buildSectionOutput(baseDir, sectionDir, sectionLabel) { + const basePath = path.join(DOCS_DIR, baseDir) + const targetDir = sectionDir ? path.join(basePath, sectionDir) : basePath + if (!fs.existsSync(targetDir)) { + return '' + } + + const mdFiles = getAllMarkdownFilesRecursive(targetDir) + if (mdFiles.length === 0) { + return '' + } + + let out = `\n# ${sectionLabel}\n\n` + + for (const filePath of mdFiles) { + const raw = readFileIfExists(filePath) + if (!raw) continue + + const { content } = await extractFrontmatterAndContent(raw, filePath) + if (!content || !content.trim()) continue + + // Content already includes title (as H2 after bumping) and description + // from prependFrontmatter + bumpHeadings in extractFrontmatterAndContent + out += content + '\n\n' + } + + return out +} + +async function generateReferenceFull() { + console.log('Generating reference-full.md from reference sections...') + + let output = '' + + for (const { base, dir, label } of SECTIONS) { + output += await buildSectionOutput(base, dir, label) + } + + // Ensure output directory exists + if (!fs.existsSync(OUTPUT_DIR)) { + fs.mkdirSync(OUTPUT_DIR, { recursive: true }) + } + + const targetPath = path.join(OUTPUT_DIR, 'reference-full.md') + fs.writeFileSync(targetPath, output.replace(/^\s+/, '')) + + const sizeKB = (Buffer.byteLength(output, 'utf8') / 1024).toFixed(2) + console.log('✅ reference-full.md generated successfully!') + console.log(` - Path: ${targetPath}`) + console.log(` - Size: ${sizeKB} KB`) +} + +generateReferenceFull().catch(error => { + console.error('Error generating reference-full.md:', error) + process.exitCode = 1 +}) + + diff --git a/scripts/generate-web-console-json.js b/scripts/generate-web-console-json.js new file mode 100644 index 000000000..f581d8dab --- /dev/null +++ b/scripts/generate-web-console-json.js @@ -0,0 +1,217 @@ +const fs = require('fs') +const path = require('path') +const yaml = require('js-yaml') + +const ROOT_DIR = path.resolve(__dirname, '..') +const DOCS_DIR = path.join(ROOT_DIR, 'documentation') +const OUTPUT_DIR = path.join(ROOT_DIR, 'static', 'web-console') +const BASE_URL = 'https://questdb.com/docs' + +// Categories to process +const DOCS_CATEGORIES = { + functions: path.join(DOCS_DIR, 'reference', 'function'), + operators: path.join(DOCS_DIR, 'reference', 'operators'), + sql: path.join(DOCS_DIR, 'reference', 'sql') +} + +/** + * Read file if it exists + */ +function readFileIfExists(filePath) { + try { + if (fs.existsSync(filePath)) { + return fs.readFileSync(filePath, 'utf8') + } + } catch (_) { + console.warn(`[generate-web-console-json] Warning: File not found: ${filePath}`) + } + return null +} + +/** + * Extract frontmatter and content from markdown + */ +function extractFrontmatterAndContent(raw) { + const frontmatterRegex = /^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/ + const match = raw.match(frontmatterRegex) + + let frontmatter = {} + let mainContent = raw + + if (match) { + try { + frontmatter = yaml.load(match[1]) || {} + } catch (_) {} + mainContent = match[2] + } + + return { + title: frontmatter.title || null, + slug: frontmatter.slug || null, + content: mainContent + } +} + +/** + * Extract headers (## and ###) from markdown content + */ +function extractHeaders(content) { + const headers = [] + const lines = content.split('\n') + + for (const line of lines) { + // Match ## headers (main function/operator names) + const match = line.match(/^##\s+(.+)$/) + if (match && !match[1].includes('Overview') && !match[1].includes('Example')) { + headers.push(match[1].trim()) + } + } + + return headers +} + +/** + * Generate URL for the documentation page + */ +function generateUrl(relativePath, slug) { + if (slug) { + // Handle custom slug + const cleanSlug = slug.startsWith('/') ? slug.substring(1) : slug + return `${BASE_URL}/${cleanSlug}/index.md` + } + + // Default: convert path to URL + // reference/function/aggregation.md -> reference/function/aggregation/index.md + const urlPath = relativePath.replace(/\.md$/, '') + return `${BASE_URL}/${urlPath}/index.md` +} + +/** + * Get all markdown files recursively + */ +function getAllMarkdownFilesRecursive(dirPath) { + const entries = fs.readdirSync(dirPath, { withFileTypes: true }) + const files = [] + + for (const entry of entries) { + const fullPath = path.join(dirPath, entry.name) + if (entry.isDirectory()) { + files.push(...getAllMarkdownFilesRecursive(fullPath)) + } else if (entry.isFile() && entry.name.endsWith('.md')) { + files.push(fullPath) + } + } + + files.sort((a, b) => a.localeCompare(b)) + return files +} + +/** + * Process a single markdown file to extract metadata + */ +function processMarkdownFile(filePath, categoryPath) { + const content = readFileIfExists(filePath) + if (!content) return null + + const { title, slug, content: mainContent } = extractFrontmatterAndContent(content) + const headers = extractHeaders(mainContent) + + // Get relative path from DOCS_DIR + const relativePath = path.relative(DOCS_DIR, filePath) + const url = generateUrl(relativePath, slug) + + return { + path: relativePath, + title: title || path.basename(filePath, '.md'), + headers: headers, + url: url + } +} + +/** + * Process a category directory + */ +function processCategory(categoryPath) { + if (!fs.existsSync(categoryPath)) { + console.error(`Category directory not found: ${categoryPath}`) + return [] + } + + const mdFiles = getAllMarkdownFilesRecursive(categoryPath) + const results = [] + + for (const filePath of mdFiles) { + const metadata = processMarkdownFile(filePath, categoryPath) + if (metadata) { + results.push(metadata) + } + } + + return results +} + +/** + * Generate ToC list from all categories + */ +function generateTocList(allMetadata) { + const tocList = {} + + for (const [category, metadata] of Object.entries(allMetadata)) { + const items = new Set() + + metadata.forEach(file => { + // Add document title + items.add(file.title) + + // Add headers (prefixed with document title for context) + file.headers.forEach(header => { + items.add(`${file.title} - ${header}`) + }) + }) + + tocList[category] = Array.from(items).sort() + } + + return tocList +} + +/** + * Main function + */ +function generateWebConsoleJson() { + console.log('Generating web console JSON files...') + + // Create output directory + if (!fs.existsSync(OUTPUT_DIR)) { + fs.mkdirSync(OUTPUT_DIR, { recursive: true }) + } + + const allMetadata = {} + + // Process each category + for (const [category, categoryPath] of Object.entries(DOCS_CATEGORIES)) { + console.log(`Processing ${category}...`) + const metadata = processCategory(categoryPath) + allMetadata[category] = metadata + + // Write category JSON file + const outputFile = path.join(OUTPUT_DIR, `${category}-docs.json`) + fs.writeFileSync(outputFile, JSON.stringify(metadata, null, 2), 'utf-8') + console.log(` ✓ Created ${outputFile} (${metadata.length} files)`) + } + + // Generate and write ToC list + const tocList = generateTocList(allMetadata) + const tocFile = path.join(OUTPUT_DIR, 'toc-list.json') + fs.writeFileSync(tocFile, JSON.stringify(tocList, null, 2), 'utf-8') + console.log(` ✓ Created ${tocFile}`) + + console.log('\n✅ Web console JSON generation complete!') +} + +try { + generateWebConsoleJson() +} catch (error) { + console.error('Error generating web console JSON:', error) + process.exitCode = 1 +} diff --git a/static/images/docs/diagrams/.railroad b/static/images/docs/diagrams/.railroad index b762bc643..1a6151886 100644 --- a/static/images/docs/diagrams/.railroad +++ b/static/images/docs/diagrams/.railroad @@ -17,12 +17,6 @@ alterServiceAccount addUser ::= 'ADD' 'USER' userName TO groupName ( ',' groupName )* -assignServiceAccount - ::= 'ASSIGN' 'SERVICE' 'ACCOUNT' serviceAccount 'TO' userOrGroup ( ',' userOrGroup )* - -unassignServiceAccount - ::= 'UNASSIGN' 'SERVICE' 'ACCOUNT' serviceAccount 'FROM' userOrGroup ( ',' userOrGroup )* - assumeServiceAccount ::= 'ASSUME' 'SERVICE' 'ACCOUNT' serviceAccount @@ -55,6 +49,9 @@ createTableDef (tableTargetVolumeDef)? ('OWNED' 'BY' ownerName)? +timestamp + ::= 'CREATE' someCreateTableStatement 'timestamp' '(' columnName ')' + createTableLike ::= 'CREATE' 'TABLE' ( '(' 'LIKE' sourceTableName ')' )? ';' @@ -70,10 +67,12 @@ createServiceAccount alterTable ::= 'ALTER' 'TABLE' tableName +alterTableAddIndex + ::= 'ALTER' 'TABLE' tableName 'ALTER' 'COLUMN' columnName 'ADD' 'INDEX' + declare ::= 'DECLARE' '@variable' ':=' expression ( ',' '@variable' ':=' expression )* withExpr? selectExpr - alterTableAddColumn ::= 'ADD' 'COLUMN' ('IF' 'NOT' 'EXISTS')? columnName typeDef (',' columnName typeDef)* ('OWNED' 'BY' ownerName)? @@ -92,10 +91,7 @@ dropUser castDef ::= 'cast' '(' columnRef 'as' typeDef ')' -inlineIndexDef - ::= 'INDEX' (indexCapacityDef)? - -typeDef +columnTypeDef ::= ( 'boolean' | 'byte' | 'short' | 'char' | 'int' | 'float' | ('symbol' (('CAPACITY' distinctValueEstimate) ('CACHE' | 'NOCACHE')?)? inlineIndexDef?) | @@ -108,7 +104,7 @@ indexDef tableTargetVolumeDef ::= ','? 'IN' 'VOLUME' "'"? secondaryVolumeAlias "'"? -insertInto +insert ::= 'INSERT' (('ATOMIC')? | ('BATCH' number ('o3MaxLag' numberWithUnit)?) ) 'INTO' tableName ( ( '(' columnName (',' columnName)*) ')')? ( 'VALUES' ( ( '(' value ( ',' value)* ')' ) (',' '(' value ( ',' value)* ')' )* ) | 'SELECT' queryDef mainQuery ) @@ -118,19 +114,6 @@ withAsInsert ::= ( 'WITH' subQueryName 'AS' '(' subQuery ')' ( ',' subQueryName 'AS' '(' subQuery ')' )* )? 'INSERT' (('ATOMIC')? | ('BATCH' number ('o3MaxLag' numberWithUnit)?) ) 'INTO' tableName 'SELECT' queryDef subQueryName ';' -insertCommitLagInto - ::= 'INSERT' ('batch' batchCount 'commitLag' n ( 'us' | 's' | 'm' | 'h' | 'd' ))? - 'INTO' tableName ( ( '(' columnName (',' columnName)*) ')')? - ( 'VALUES' ( ( '(' value ( ',' value)* ')' ) (',' '(' value ( ',' value)* ')' )* ) | 'SELECT' queryDef mainQuery ) - ';' - -withAsInsertCommitLag - ::= ( 'WITH' subQueryName 'AS' '(' subQuery ')' ( ',' subQueryName 'AS' '(' subQuery ')' )* )? - 'INSERT' ( 'batch' batchCount 'commitLag' n ( 'us' | 's' | 'm' | 'h' | 'd' ) )? 'INTO' tableName 'SELECT' queryDef subQueryName ';' - -backup - ::= 'BACKUP' ( 'TABLE' tableName ( ',' tableName )* | 'DATABASE' ) ';' - checkpoint ::= 'CHECKPOINT' ( 'CREATE' | 'RELEASE' ) ';' @@ -140,12 +123,10 @@ case copy ::= 'COPY' (id 'CANCEL' | tableName 'FROM' fileName (| 'WITH' (| 'HEADER' (true|false) |'TIMESTAMP' columnName | 'DELIMITER' delimiter | 'FORMAT' format | |'PARTITION BY' ('NONE'|'YEAR'|'MONTH'|'DAY'|'HOUR') | 'ON ERROR' ('SKIP_ROW'|'SKIP_COLUMN'|'ABORT')) )) -createTableTimestamp - ::= 'CREATE' someCreateTableStatement 'timestamp' '(' columnName ')' +select + ::= ('SELECT' ( (column | expression | function) ('AS' alias | alias)? (',' (column | expression | function) ('AS' alias | alias)? )* ) 'FROM')? ( table | '(' query ')') ('AS' alias | alias)? -createTableWithCommitParams - ::= 'WITH' 'maxUncommittedRows' '=' rowCount ',' 'commitLag' '=' n ( 'us' | 's' | 'm' | 'h' | 'd' ) -createTableWithMaxRowParams +createTableWithMaxRowParam ::= 'WITH' 'maxUncommittedRows' '=' rowCount dynamicTimestamp @@ -163,12 +144,9 @@ alignToCalTimeZone distinct ::= 'SELECT' 'DISTINCT' ( columnName (',' columnName)* ) 'FROM' tableName -latestBy +latestOn ::= 'SELECT' ( columnName (',' columnName)* ) 'FROM' tableName 'LATEST' 'ON' '(' columnName ')' 'PARTITION' 'BY' ( columnName (',' columnName)* ) -latestByDeprecated - ::= 'SELECT' ( columnName (',' columnName)* ) 'FROM' tableName 'LATEST' 'BY' ( columnName (',' columnName)* ) - limit ::= 'SELECT' someSelectStatement 'LIMIT' ( numberOfRecords | (lowerBound ',' upperBound) ) ';' @@ -178,45 +156,42 @@ fill orderBy ::= someSelectQuery 'ORDER' 'BY' ( columnName (ASC | DESC) ? (',' columnName (asc | desc) ?)* ) -timestampSearch - ::= 'WHERE' timestampColumn ( '=' | '>' | '<' | '>=' | '<=' ) "'" timestamp "'" +where + ::= (selectStatement | '(' query ')' ) 'WHERE' boolean_expr -timestampIntervalSearch - ::= 'WHERE' timestampColumn 'IN' "'" timestamp ';' multiplier ( s | m | h | d | M | y ) ';' ( occurrence ( s | m | h | d | M | y ) ';' repetition )? "'" +whereTimestampIntervalSearch + ::= 'WHERE' timestampColumn 'IN' "'" timestamp ';' modifier ( s | m | h | d | M | y ) ';' ( interval ( s | m | h | d | M | y ) ';' repetition )? "'" -timestampInSearch - ::= 'WHERE' timestampColumn 'IN' '(' "'timestamp1'" ';' "'timestamp2'" ')' - -exactStringOrSymbolSearch +whereExactString ::= 'WHERE' column '=' "'" string "'" -regexMatch +whereStringNotMatch + ::= 'WHERE' column '!=' "'" string "'" + +whereRegexMatch + ::= 'WHERE' column '~' regex + +whereRegexNotMatch ::= 'WHERE' '~=' '(' column ';' regex ')' -listMatch +whereListIn ::= 'WHERE' 'NOT'? columnName 'in' '(' string (',' string)* ')' whereNumericValue ::= 'WHERE' column ('=' | '!=' | '>' | '>=' | '<' | '<=') value -whereEqDoubleProximityPrecision - ::= 'WHERE' 'eq' '(' column ',' value ',' precision ')' - -complexWhere +whereComplex ::= 'WHERE' ('('? ( 'AND' | 'OR' | 'NOT' )? boolean ')'?)* -booleanWhere +whereBoolean ::= 'WHERE' 'NOT'? columnName -timestampExact +whereTimestampExact ::= 'WHERE' column '=' timestamp -timestampPartial +whereTimestampPartial ::= 'WHERE' timestampColumn 'IN' ( 'yyyy' | 'yyyy-MM' | 'YYYY-MM-dd' | 'yyyy-MM-ddThh' | 'yyyy-MM-ddThh:mm' | 'yyyy-MM-ddThh:mm:ss' ) -timestampExplicitRange - ::= 'WHERE' timestamp 'IN' '(' lower_bound ',' upper_bound ')' - unionExceptIntersect ::= query_1 ('UNION' | 'EXCEPT' | 'INTERSECT') 'ALL'? query_2 @@ -226,16 +201,10 @@ renameTable cast ::= 'CAST' '(' expression 'AS' type ')' -influxLineProtocolOverTCP - ::= (user_1 | user_2 | '...') 'TCP requests' network_IO_thread 'write_queue' ((worker_1 'write' (table_1|table_2|'...')) | (worker_2 'write' (table_3|table_4|'...'))) - -influxLineProtocolOverTCPLoadRebalance - ::= Launch_Load_Balancing_Job ('IF' load_ratio '>' 'max.load.ratio' Rebalance_Load)? ( 'IF' (updates_since_last_rebalance '<' 'n.updates.per.load.balance' | time_since_last_rebalance '<' 'maintenance.job.interval') Launch_Load_Balancing_Job ('IF' load_ratio '>' 'max.load.ratio' Rebalance_Load)? )* - joinOverview ::= selectClause joinStatement ( 'WHERE' whereClause )? -innerLeftJoin +InnerLeftJoin ::= ( 'INNER' | 'LEFT' )? 'JOIN' ( table | '(' sub-query ')' ) ( 'ON' ( ( column operator anotherColumn ) ( 'AND' ( column operator anotherColumn ) )* | '(' column ( ',' column )* ')' ) )? AsofLtSpliceJoin @@ -245,7 +214,6 @@ AsofLtSpliceJoin AsofJoin ::= 'ASOF' 'JOIN' ( table | '(' sub-query ')' ) ( 'ON' ( column '=' anotherColumn ( 'AND' column '=' anotherColumn )* | '(' column ( ',' column )* ')' ) )? ( 'TOLERANCE' interval_literal )? - crossJoin ::= 'CROSS' 'JOIN' ( table | '(' sub-query ')' ) @@ -257,10 +225,10 @@ revoke ::= 'REVOKE' permission ( ',' permission )* ( 'ON' tableName ( '(' 'columnName' ( ',' columnName )* ')' )? ( ',' tableName ( '(' 'columnName' ( ',' columnName )* ')' )? )* )? 'FROM' entityName -grantAssume +grantAssumeServiceAccount ::= 'GRANT' 'ASSUME' 'SERVICE' 'ACCOUNT' serviceAccount 'TO' entityName ( 'WITH' 'GRANT' 'OPTION' )? -revokeAssume +revokeAssumeServiceAccount ::= 'REVOKE' 'ASSUME' 'SERVICE' 'ACCOUNT' serviceAccount 'FROM' entityName groupBy @@ -269,20 +237,14 @@ groupBy with ::= 'WITH' ( subQueryName 'AS' '(' subQuery ')' ( ',' subQueryName 'AS' '(' subQuery ')' )*) mainQuery -addIndex - ::= 'ALTER' 'COLUMN' columnName 'ADD' 'INDEX' - dropIndex ::= 'ALTER' 'COLUMN' columnName 'DROP' 'INDEX' -noCacheColumn +alterTableNoCache ::= 'ALTER' 'TABLE' tableName 'ALTER' 'COLUMN' columnName ( 'NOCACHE' | 'CACHE' ) -dropColumn - ::= 'DROP' 'COLUMN' columnName (',' columnName)* ':' - -addColumn - ::= 'ADD' 'COLUMN' columnName typeDef (',' columnName typeDef)* ('OWNED' 'BY' ownerName)? +alterTableDropColumn + ::= 'DROP' 'COLUMN' columnName (',' columnName)* ';' alterColumnType ::= 'ALTER' 'TABLE' tableName 'ALTER' 'COLUMN' columnName 'TYPE' typeDef @@ -290,7 +252,7 @@ alterColumnType alterTableSymbolCapacity ::= 'ALTER' 'TABLE' tableName 'ALTER' 'COLUMN' columnName 'SYMBOL' 'CAPACITY' capacity -dropPartition +alterTableDropPartition ::= 'DROP' 'PARTITION' 'LIST' partitionName (',' partitionName)* removeUser @@ -299,24 +261,24 @@ removeUser reindexTable ::= 'REINDEX' 'TABLE' tableName ('COLUMN' columnName)* ('PARTITION' partitionName)* 'LOCK' 'EXCLUSIVE' -renameColumn +alterTableRenameColumn ::= 'RENAME' 'COLUMN' columnName 'TO' newColumnName -attachPartition +alterTableAttachPartition ::= 'ALTER' 'TABLE' tableName 'ATTACH' 'PARTITION' 'LIST' partitionName (',' partitionName)* -detachPartition +alterTableDetachPartition ::= 'ALTER' 'TABLE' tableName 'DETACH' 'PARTITION' 'LIST' partitionName (',' partitionName)* | 'ALTER' 'TABLE' tableName 'DETACH' 'PARTITION' 'WHERE' timestampColumn ( '=' | '>' | '<' | '>=' | '<=' ) "'" timestamp "'" | 'ALTER' 'TABLE' tableName 'DETACH' 'PARTITION' 'WHERE' timestampColumn 'IN' '(' timestamp (',' timestamp)* ')' -squashPartitions +alterTableSquashPartitions ::= 'SQUASH' 'PARTITIONS' tableName ';' -setParam +alterTableSetParam ::= 'SET' 'PARAM' ( 'maxUncommittedRows' '=' n) -setParamCommitLag +alterTableSetParamCommitLag ::= 'SET' 'PARAM' ( 'maxUncommittedRows' '=' n | 'commitLag' '=' n ( 'us' | 's' | 'm' | 'h' | 'd' )) vacuumTable @@ -348,17 +310,15 @@ show | 'PARAMETERS' ) +snapshot + ::= 'SNAPSHOT' ('PREPARE' | 'COMPLETE') ';' + truncateTable ::= 'TRUNCATE TABLE' ('IF' 'EXISTS')? tableName ';' explain ::= 'EXPLAIN' statement -windowFunction - ::= functionName 'OVER' '(' ( 'PARTITION' 'BY' ( columnName? (',' columnName?)* ))? ('ORDER' 'BY' ( columnName ('ASC' | 'DESC') ? (',' columnName ('ASC' | 'DESC') ?)* ))? ( ( 'RANGE' | 'ROWS' ) - ( ( 'UNBOUNDED' 'PRECEDING' | offset 'PRECEDING' | 'CURRENT' 'ROW' ) | 'BETWEEN' ( 'UNBOUNDED' 'PRECEDING' | offset 'PRECEDING' | 'CURRENT' 'ROW' ) AND ( offset 'PRECEDING' | 'CURRENT' 'ROW' ) )? - ( 'EXCLUDE' 'CURRENT' 'ROW' | 'EXCLUDE' 'NO' 'OTHERS' )? )? ')' - disableDedup ::= 'ALTER' 'TABLE' tableName 'DEDUP' 'DISABLE' diff --git a/static/images/docs/diagrams/aAsofLtSpliceJoin.svg b/static/images/docs/diagrams/aAsofLtSpliceJoin.svg deleted file mode 100644 index 7fae46efc..000000000 --- a/static/images/docs/diagrams/aAsofLtSpliceJoin.svg +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - ASOF - - - LT - - - SPLICE - - - JOIN - - - table - - ( - - - sub-query - - ) - - - ON - - - column - - = - - - anotherColumn - - AND - - - ( - - - column - - , - - - ) - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/addColumn.svg b/static/images/docs/diagrams/addColumn.svg deleted file mode 100644 index 19ce6895f..000000000 --- a/static/images/docs/diagrams/addColumn.svg +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - ADD - - - COLUMN - - - columnName - - - typeDef - - , - - - OWNED - - - BY - - - ownerName - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/addIndex.svg b/static/images/docs/diagrams/addIndex.svg deleted file mode 100644 index bd63d1c04..000000000 --- a/static/images/docs/diagrams/addIndex.svg +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - ALTER - - - COLUMN - - - columnName - - ADD - - - INDEX - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/alterTableAddIndex.svg b/static/images/docs/diagrams/alterTableAddIndex.svg index 61b0262b1..daec2140d 100644 --- a/static/images/docs/diagrams/alterTableAddIndex.svg +++ b/static/images/docs/diagrams/alterTableAddIndex.svg @@ -1 +1,58 @@ -ALTERCOLUMNcolumnNameADDINDEX \ No newline at end of file + + + + + + + + + ALTER + + + TABLE + + + tableName + + ALTER + + + COLUMN + + + columnName + + ADD + + + INDEX + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/alterTableAttachPartition.svg b/static/images/docs/diagrams/alterTableAttachPartition.svg index ca60d1f93..36042ee3f 100644 --- a/static/images/docs/diagrams/alterTableAttachPartition.svg +++ b/static/images/docs/diagrams/alterTableAttachPartition.svg @@ -1 +1,58 @@ -ALTERTABLEtableNameATTACHPARTITIONLISTpartitionName, \ No newline at end of file + + + + + + + + + ALTER + + + TABLE + + + tableName + + ATTACH + + + PARTITION + + + LIST + + + partitionName + + , + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/alterTableDetachPartition.svg b/static/images/docs/diagrams/alterTableDetachPartition.svg index f904d8f64..7f84e90a0 100644 --- a/static/images/docs/diagrams/alterTableDetachPartition.svg +++ b/static/images/docs/diagrams/alterTableDetachPartition.svg @@ -1 +1,100 @@ -ALTERTABLEtableNameDETACHPARTITIONLISTpartitionName,WHEREtimestampColumn=><>=<='timestamp'IN(timestamp,) \ No newline at end of file + + + + + + + + + ALTER + + + TABLE + + + tableName + + DETACH + + + PARTITION + + + LIST + + + partitionName + + , + + + WHERE + + + timestampColumn + + = + + + > + + + < + + + >= + + + <= + + + ' + + + timestamp + + ' + + + IN + + + ( + + + timestamp + + , + + + ) + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/alterTableDropColumn.svg b/static/images/docs/diagrams/alterTableDropColumn.svg index 28b62e5db..3a0dbd4c5 100644 --- a/static/images/docs/diagrams/alterTableDropColumn.svg +++ b/static/images/docs/diagrams/alterTableDropColumn.svg @@ -1 +1,50 @@ -DROPCOLUMNcolumnName,; \ No newline at end of file + + + + + + + + + DROP + + + COLUMN + + + columnName + + , + + + ; + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/alterTableDropPartition.svg b/static/images/docs/diagrams/alterTableDropPartition.svg index c975ac28f..1938f86a3 100644 --- a/static/images/docs/diagrams/alterTableDropPartition.svg +++ b/static/images/docs/diagrams/alterTableDropPartition.svg @@ -1 +1,50 @@ -DROPPARTITIONLISTpartitionName, \ No newline at end of file + + + + + + + + + DROP + + + PARTITION + + + LIST + + + partitionName + + , + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/alterTableNoCache.svg b/static/images/docs/diagrams/alterTableNoCache.svg index f52a28bee..a18867bcd 100644 --- a/static/images/docs/diagrams/alterTableNoCache.svg +++ b/static/images/docs/diagrams/alterTableNoCache.svg @@ -1 +1,58 @@ -ALTERCOLUMNcolumnNameNOCACHECACHE \ No newline at end of file + + + + + + + + + ALTER + + + TABLE + + + tableName + + ALTER + + + COLUMN + + + columnName + + NOCACHE + + + CACHE + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/alterTableRenameColumn.svg b/static/images/docs/diagrams/alterTableRenameColumn.svg index 937aa3dba..b368c4791 100644 --- a/static/images/docs/diagrams/alterTableRenameColumn.svg +++ b/static/images/docs/diagrams/alterTableRenameColumn.svg @@ -1 +1,49 @@ -RENAMECOLUMNcolumnNameTOnewColumnName \ No newline at end of file + + + + + + + + + RENAME + + + COLUMN + + + columnName + + TO + + + newColumnName + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/alterTableResumeWal.svg b/static/images/docs/diagrams/alterTableResumeWal.svg deleted file mode 100644 index fa08a3e25..000000000 --- a/static/images/docs/diagrams/alterTableResumeWal.svg +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - RESUME - - - WAL - - - FROM - - - TRANSACTION - - - TXN - - - sequencerTxn - - \ No newline at end of file diff --git a/static/images/docs/diagrams/alterTableSetParam.svg b/static/images/docs/diagrams/alterTableSetParam.svg index 61ad53b02..7f291a661 100644 --- a/static/images/docs/diagrams/alterTableSetParam.svg +++ b/static/images/docs/diagrams/alterTableSetParam.svg @@ -1 +1,50 @@ -SETPARAMmaxUncommittedRows=n \ No newline at end of file + + + + + + + + + SET + + + PARAM + + + maxUncommittedRows + + + = + + + n + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/alterTableSetParamCommitLag.svg b/static/images/docs/diagrams/alterTableSetParamCommitLag.svg index 667800ef6..b7eae136f 100644 --- a/static/images/docs/diagrams/alterTableSetParamCommitLag.svg +++ b/static/images/docs/diagrams/alterTableSetParamCommitLag.svg @@ -1 +1,73 @@ -SETPARAMmaxUncommittedRows=ncommitLag=nussmhd \ No newline at end of file + + + + + + + + + SET + + + PARAM + + + maxUncommittedRows + + + = + + + n + + commitLag + + + = + + + n + + us + + + s + + + m + + + h + + + d + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/alterTableSquashPartitions.svg b/static/images/docs/diagrams/alterTableSquashPartitions.svg index cd39991a6..27653aa56 100644 --- a/static/images/docs/diagrams/alterTableSquashPartitions.svg +++ b/static/images/docs/diagrams/alterTableSquashPartitions.svg @@ -1 +1,47 @@ -SQUASHPARTITIONStableName; \ No newline at end of file + + + + + + + + + SQUASH + + + PARTITIONS + + + tableName + + ; + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/assignServiceAccount.svg b/static/images/docs/diagrams/assignServiceAccount.svg deleted file mode 100644 index 43b8b291e..000000000 --- a/static/images/docs/diagrams/assignServiceAccount.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - ASSIGN - - - SERVICE - - - ACCOUNT - - - serviceAccount - - TO - - - userOrGroup - - , - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/attachPartition.svg b/static/images/docs/diagrams/attachPartition.svg deleted file mode 100644 index 36042ee3f..000000000 --- a/static/images/docs/diagrams/attachPartition.svg +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - ALTER - - - TABLE - - - tableName - - ATTACH - - - PARTITION - - - LIST - - - partitionName - - , - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/backup.svg b/static/images/docs/diagrams/backup.svg deleted file mode 100644 index 42763f771..000000000 --- a/static/images/docs/diagrams/backup.svg +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - BACKUP - - - TABLE - - - tableName - - , - - - DATABASE - - - ; - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/booleanWhere.svg b/static/images/docs/diagrams/booleanWhere.svg deleted file mode 100644 index a4a68a07a..000000000 --- a/static/images/docs/diagrams/booleanWhere.svg +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - WHERE - - - NOT - - - columnName - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/columnTypeDef.svg b/static/images/docs/diagrams/columnTypeDef.svg index 056784c3a..c0301dd23 100644 --- a/static/images/docs/diagrams/columnTypeDef.svg +++ b/static/images/docs/diagrams/columnTypeDef.svg @@ -1 +1,97 @@ -booleanbyteshortcharintfloatsymbolCAPACITYdistinctValueEstimateCACHENOCACHEinlineIndexDefstringlongdatetimestampdoublebinarylong256geohash(<size>) \ No newline at end of file + + + + + + + + + boolean + + + byte + + + short + + + char + + + int + + + float + + + symbol + + + CAPACITY + + + distinctValueEstimate + + CACHE + + + NOCACHE + + + inlineIndexDef + + varchar + + + string + + + long + + + date + + + timestamp + + + double + + + binary + + + long256 + + + geohash(<size>) + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/complexWhere.svg b/static/images/docs/diagrams/complexWhere.svg deleted file mode 100644 index 19d0032ac..000000000 --- a/static/images/docs/diagrams/complexWhere.svg +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - WHERE - - - ( - - - AND - - - OR - - - NOT - - - boolean - - ) - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/createTable.svg b/static/images/docs/diagrams/createTable.svg deleted file mode 100644 index 9b76b3b1b..000000000 --- a/static/images/docs/diagrams/createTable.svg +++ /dev/null @@ -1,386 +0,0 @@ - - - - - - - - - - CREATE - - - ATOMIC - - - BATCH - - - - number - - - - o3MaxLag - - - - numberWithUnit - - - - TABLE - - - IF - - - NOT - - - EXISTS - - - - tableName - - - - ( - - - - columnName - - - - - typeDef - - - - , - - - ) - - - AS - - - ( - - - - selectSql - - - - ) - - - , - - - - castDef - - - - , - - - - indexDef - - - - timestamp - - - ( - - - - columnRef - - - - ) - - - PARTITION - - - BY - - - NONE - - - BYPASS - - - WAL - - - YEAR - - - MONTH - - - DAY - - - HOUR - - - BYPASS - - - WAL - - - WITH - - - - tableParameter - - - - - tableTargetVolumeDef - - - - OWNED - - - BY - - - - ownerName - - - - - diff --git a/static/images/docs/diagrams/createTableDef.svg b/static/images/docs/diagrams/createTableDef.svg index 16d59812b..a17e6a669 100644 --- a/static/images/docs/diagrams/createTableDef.svg +++ b/static/images/docs/diagrams/createTableDef.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/static/images/docs/diagrams/createTableTimestamp.svg b/static/images/docs/diagrams/createTableTimestamp.svg deleted file mode 100644 index 5bb0db083..000000000 --- a/static/images/docs/diagrams/createTableTimestamp.svg +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - CREATE - - - someCreateTableStatement - - timestamp - - - ( - - - columnName - - ) - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/createTableWithCommitParam.svg b/static/images/docs/diagrams/createTableWithCommitParam.svg deleted file mode 100644 index 4a8f15388..000000000 --- a/static/images/docs/diagrams/createTableWithCommitParam.svg +++ /dev/null @@ -1 +0,0 @@ -WITHmaxUncommittedRows=rowCount,commitLag=nussmhd \ No newline at end of file diff --git a/static/images/docs/diagrams/createTableWithCommitParams.svg b/static/images/docs/diagrams/createTableWithCommitParams.svg deleted file mode 100644 index a9aedc87c..000000000 --- a/static/images/docs/diagrams/createTableWithCommitParams.svg +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - WITH - - - maxUncommittedRows - - - = - - - rowCount - - , - - - commitLag - - - = - - - n - - us - - - s - - - m - - - h - - - d - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/createTableWithMaxRowParam.svg b/static/images/docs/diagrams/createTableWithMaxRowParam.svg index c0dd45413..d7293d060 100644 --- a/static/images/docs/diagrams/createTableWithMaxRowParam.svg +++ b/static/images/docs/diagrams/createTableWithMaxRowParam.svg @@ -1 +1,47 @@ -WITHmaxUncommittedRows=rowCount \ No newline at end of file + + + + + + + + + WITH + + + maxUncommittedRows + + + = + + + rowCount + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/createTableWithMaxRowParams.svg b/static/images/docs/diagrams/createTableWithMaxRowParams.svg deleted file mode 100644 index d7293d060..000000000 --- a/static/images/docs/diagrams/createTableWithMaxRowParams.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - WITH - - - maxUncommittedRows - - - = - - - rowCount - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/declare.svg b/static/images/docs/diagrams/declare.svg index 367699a4c..86040c80d 100644 --- a/static/images/docs/diagrams/declare.svg +++ b/static/images/docs/diagrams/declare.svg @@ -1,91 +1,55 @@ - - - - - - DECLARE - - - @variable - - - := - - - - expression - - - - , - - - - withExpr - - - - - selectExpr - - - - - + + + + + DECLARE + + + @variable + + + := + + + expression + + , + + + withExpr + + + selectExpr + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/detachPartition.svg b/static/images/docs/diagrams/detachPartition.svg deleted file mode 100644 index 7f84e90a0..000000000 --- a/static/images/docs/diagrams/detachPartition.svg +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - ALTER - - - TABLE - - - tableName - - DETACH - - - PARTITION - - - LIST - - - partitionName - - , - - - WHERE - - - timestampColumn - - = - - - > - - - < - - - >= - - - <= - - - ' - - - timestamp - - ' - - - IN - - - ( - - - timestamp - - , - - - ) - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/dropColumn.svg b/static/images/docs/diagrams/dropColumn.svg deleted file mode 100644 index 0c73bce4a..000000000 --- a/static/images/docs/diagrams/dropColumn.svg +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - DROP - - - COLUMN - - - columnName - - , - - - : - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/dropPartition.svg b/static/images/docs/diagrams/dropPartition.svg deleted file mode 100644 index 1938f86a3..000000000 --- a/static/images/docs/diagrams/dropPartition.svg +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - DROP - - - PARTITION - - - LIST - - - partitionName - - , - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/exactStringOrSymbolSearch.svg b/static/images/docs/diagrams/exactStringOrSymbolSearch.svg deleted file mode 100644 index e01ac1928..000000000 --- a/static/images/docs/diagrams/exactStringOrSymbolSearch.svg +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - WHERE - - - column - - = - - - ' - - - string - - ' - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/fromTo.svg b/static/images/docs/diagrams/fromTo.svg index d55ce75e1..8c18e63fc 100644 --- a/static/images/docs/diagrams/fromTo.svg +++ b/static/images/docs/diagrams/fromTo.svg @@ -1,90 +1,53 @@ - - - - - - - someSampleBySelectQuery... - - - - FROM - - - - lowerBound - - - - TO - - - - upperBound - - - - TO - - - - upperBound - - - - - + + + + + someSampleBySelectQuery... + + FROM + + + lowerBound + + TO + + + upperBound + + TO + + + upperBound + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/grantAssume.svg b/static/images/docs/diagrams/grantAssume.svg deleted file mode 100644 index 5879ae97b..000000000 --- a/static/images/docs/diagrams/grantAssume.svg +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - GRANT - - - ASSUME - - - SERVICE - - - ACCOUNT - - - serviceAccount - - TO - - - entityName - - WITH - - - GRANT - - - OPTION - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/grantAssumeServiceAccount.svg b/static/images/docs/diagrams/grantAssumeServiceAccount.svg index 953ae4315..5879ae97b 100644 --- a/static/images/docs/diagrams/grantAssumeServiceAccount.svg +++ b/static/images/docs/diagrams/grantAssumeServiceAccount.svg @@ -1,64 +1,64 @@ - + - - - - - GRANT - - - ASSUME - - - SERVICE - - - ACCOUNT - - - serviceAccount - - TO - - - entityName - - WITH - - - GRANT - - - OPTION - - - - + + + + + GRANT + + + ASSUME + + + SERVICE + + + ACCOUNT + + + serviceAccount + + TO + + + entityName + + WITH + + + GRANT + + + OPTION + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/influxLineProtocolOverTCP.svg b/static/images/docs/diagrams/influxLineProtocolOverTCP.svg deleted file mode 100644 index 2b79b8c42..000000000 --- a/static/images/docs/diagrams/influxLineProtocolOverTCP.svg +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - user_1 - - - user_2 - - ... - - - TCP requests - - - network_IO_thread - - write_queue - - - worker_1 - - write - - - table_1 - - - table_2 - - ... - - - worker_2 - - write - - - table_3 - - - table_4 - - ... - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/influxLineProtocolOverTCPLoadRebalance.svg b/static/images/docs/diagrams/influxLineProtocolOverTCPLoadRebalance.svg deleted file mode 100644 index 06ea39bec..000000000 --- a/static/images/docs/diagrams/influxLineProtocolOverTCPLoadRebalance.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - Launch_Load_Balancing_Job - - IF - - - load_ratio - - > - - - max.load.ratio - - - Rebalance_Load - - n.updates.per.load.balance - - - < - - - updates_since_last_rebalance - - maintenance.job.interval - - - < - - - time_since_last_rebalance - - IF - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/influxLineProtocolTCPLoadBalancing.svg b/static/images/docs/diagrams/influxLineProtocolTCPLoadBalancing.svg deleted file mode 100644 index 04acdbb49..000000000 --- a/static/images/docs/diagrams/influxLineProtocolTCPLoadBalancing.svg +++ /dev/null @@ -1 +0,0 @@ -Launch_Load_Balancing_JobIFload_ratio>max.load.ratioRebalance_Loadn.updates.per.load.balance<updates_since_last_rebalancemaintenance.job.interval<time_since_last_rebalanceIF \ No newline at end of file diff --git a/static/images/docs/diagrams/influxLineProtocolTCPStructure.svg b/static/images/docs/diagrams/influxLineProtocolTCPStructure.svg deleted file mode 100644 index 49eef2948..000000000 --- a/static/images/docs/diagrams/influxLineProtocolTCPStructure.svg +++ /dev/null @@ -1 +0,0 @@ -user_1user_2...TCP requestsnetwork_IO_threadwrite_queueworker_1writetable_1table_2...worker_2writetable_3table_4... \ No newline at end of file diff --git a/static/images/docs/diagrams/inlineIndexDef.svg b/static/images/docs/diagrams/inlineIndexDef.svg deleted file mode 100644 index 2baae5c18..000000000 --- a/static/images/docs/diagrams/inlineIndexDef.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - INDEX - - - indexCapacityDef - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/insert.svg b/static/images/docs/diagrams/insert.svg index 8d9995210..69cefeeb8 100644 --- a/static/images/docs/diagrams/insert.svg +++ b/static/images/docs/diagrams/insert.svg @@ -1,207 +1,96 @@ - - - - - - INSERT - - - ATOMIC - - - BATCH - - - - number - - - - o3MaxLag - - - - numberWithUnit - - - - INTO - - - - tableName - - - - ( - - - - columnName - - - - , - - - ) - - - VALUES - - - ( - - - - value - - - - , - - - ) - - - , - - - SELECT - - - - queryDef - - - - - mainQuery - - - - ; - - - - + + + + + INSERT + + + ATOMIC + + + BATCH + + + number + + o3MaxLag + + + numberWithUnit + + INTO + + + tableName + + ( + + + columnName + + , + + + ) + + + VALUES + + + ( + + + value + + , + + + ) + + + , + + + SELECT + + + queryDef + + + mainQuery + + ; + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/insertCommitLag.svg b/static/images/docs/diagrams/insertCommitLag.svg deleted file mode 100644 index ee7a00437..000000000 --- a/static/images/docs/diagrams/insertCommitLag.svg +++ /dev/null @@ -1 +0,0 @@ -INSERTbatchbatchCountcommitLagnussmhdINTOtableName(columnName,)VALUES(value,),SELECTqueryDefmainQuery; \ No newline at end of file diff --git a/static/images/docs/diagrams/insertCommitLagInto.svg b/static/images/docs/diagrams/insertCommitLagInto.svg deleted file mode 100644 index ab432e620..000000000 --- a/static/images/docs/diagrams/insertCommitLagInto.svg +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - INSERT - - - batch - - - batchCount - - commitLag - - - n - - us - - - s - - - m - - - h - - - d - - - INTO - - - tableName - - ( - - - columnName - - , - - - ) - - - VALUES - - - ( - - - value - - , - - - ) - - - , - - - SELECT - - - queryDef - - - mainQuery - - ; - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/insertInto.svg b/static/images/docs/diagrams/insertInto.svg deleted file mode 100644 index 9e634f9c5..000000000 --- a/static/images/docs/diagrams/insertInto.svg +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - INSERT - - - batch - - - batchCount - - INTO - - - tableName - - ( - - - columnName - - , - - - ) - - - VALUES - - - ( - - - value - - , - - - ) - - - , - - - SELECT - - - queryDef - - - mainQuery - - ; - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/latestBy.svg b/static/images/docs/diagrams/latestBy.svg deleted file mode 100644 index d9f70b608..000000000 --- a/static/images/docs/diagrams/latestBy.svg +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - SELECT - - - columnName - - , - - - FROM - - - tableName - - LATEST - - - ON - - - ( - - - columnName - - ) - - - PARTITION - - - BY - - - columnName - - , - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/latestByDeprecated.svg b/static/images/docs/diagrams/latestByDeprecated.svg deleted file mode 100644 index 7b6be460e..000000000 --- a/static/images/docs/diagrams/latestByDeprecated.svg +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - SELECT - - - columnName - - , - - - FROM - - - tableName - - LATEST - - - BY - - - columnName - - , - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/latestOn.svg b/static/images/docs/diagrams/latestOn.svg index c88da6837..d9f70b608 100644 --- a/static/images/docs/diagrams/latestOn.svg +++ b/static/images/docs/diagrams/latestOn.svg @@ -1 +1,74 @@ -SELECTcolumnName,FROMtableNameLATESTON(columnName)PARTITIONBYcolumnName, \ No newline at end of file + + + + + + + + + SELECT + + + columnName + + , + + + FROM + + + tableName + + LATEST + + + ON + + + ( + + + columnName + + ) + + + PARTITION + + + BY + + + columnName + + , + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/listMatch.svg b/static/images/docs/diagrams/listMatch.svg deleted file mode 100644 index 10454ca4f..000000000 --- a/static/images/docs/diagrams/listMatch.svg +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - WHERE - - - NOT - - - columnName - - in - - - ( - - - string - - , - - - ) - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/noCacheColumn.svg b/static/images/docs/diagrams/noCacheColumn.svg deleted file mode 100644 index a18867bcd..000000000 --- a/static/images/docs/diagrams/noCacheColumn.svg +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - ALTER - - - TABLE - - - tableName - - ALTER - - - COLUMN - - - columnName - - NOCACHE - - - CACHE - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/regexMatch.svg b/static/images/docs/diagrams/regexMatch.svg deleted file mode 100644 index 7814bd33c..000000000 --- a/static/images/docs/diagrams/regexMatch.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - WHERE - - - ~= - - - ( - - - column - - ; - - - regex - - ) - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/reindex.svg b/static/images/docs/diagrams/reindex.svg deleted file mode 100644 index 07ed0fea3..000000000 --- a/static/images/docs/diagrams/reindex.svg +++ /dev/null @@ -1 +0,0 @@ -REINDEXTABLEtableNameCOLUMNcolumnNamePARTITIONpartitionNameLOCKEXCLUSIVE \ No newline at end of file diff --git a/static/images/docs/diagrams/renameColumn.svg b/static/images/docs/diagrams/renameColumn.svg deleted file mode 100644 index b368c4791..000000000 --- a/static/images/docs/diagrams/renameColumn.svg +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - RENAME - - - COLUMN - - - columnName - - TO - - - newColumnName - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/revokeAssume.svg b/static/images/docs/diagrams/revokeAssume.svg deleted file mode 100644 index f5a2ff624..000000000 --- a/static/images/docs/diagrams/revokeAssume.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - REVOKE - - - ASSUME - - - SERVICE - - - ACCOUNT - - - serviceAccount - - FROM - - - entityName - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/revokeAssumeServiceAccount.svg b/static/images/docs/diagrams/revokeAssumeServiceAccount.svg index b5c3ae67b..f5a2ff624 100644 --- a/static/images/docs/diagrams/revokeAssumeServiceAccount.svg +++ b/static/images/docs/diagrams/revokeAssumeServiceAccount.svg @@ -1,55 +1,55 @@ - + - - - - - REVOKE - - - ASSUME - - - SERVICE - - - ACCOUNT - - - serviceAccount - - FROM - - - entityName - - - + + + + + REVOKE + + + ASSUME + + + SERVICE + + + ACCOUNT + + + serviceAccount + + FROM + + + entityName + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/select.svg b/static/images/docs/diagrams/select.svg index 98f37b343..c502c5ddd 100644 --- a/static/images/docs/diagrams/select.svg +++ b/static/images/docs/diagrams/select.svg @@ -1 +1,73 @@ -selectcolumnexpressionfunctionalias,fromtable(query)alias \ No newline at end of file + + + + + + + + + SELECT + + + column + + + expression + + + function + + AS + + + alias + + , + + + FROM + + + table + + ( + + + query + + ) + + + AS + + + alias + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/setParam.svg b/static/images/docs/diagrams/setParam.svg deleted file mode 100644 index 7f291a661..000000000 --- a/static/images/docs/diagrams/setParam.svg +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - SET - - - PARAM - - - maxUncommittedRows - - - = - - - n - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/setParamCommitLag.svg b/static/images/docs/diagrams/setParamCommitLag.svg deleted file mode 100644 index b7eae136f..000000000 --- a/static/images/docs/diagrams/setParamCommitLag.svg +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - SET - - - PARAM - - - maxUncommittedRows - - - = - - - n - - commitLag - - - = - - - n - - us - - - s - - - m - - - h - - - d - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/snapshot.svg b/static/images/docs/diagrams/snapshot.svg index 2b852e6e4..8e949ffa4 100644 --- a/static/images/docs/diagrams/snapshot.svg +++ b/static/images/docs/diagrams/snapshot.svg @@ -1 +1,48 @@ -SNAPSHOTPREPARECOMPLETE; \ No newline at end of file + + + + + + + + + SNAPSHOT + + + PREPARE + + + COMPLETE + + + ; + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/squashPartitions.svg b/static/images/docs/diagrams/squashPartitions.svg deleted file mode 100644 index 27653aa56..000000000 --- a/static/images/docs/diagrams/squashPartitions.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - SQUASH - - - PARTITIONS - - - tableName - - ; - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/timestamp.svg b/static/images/docs/diagrams/timestamp.svg index 5cc588a99..5bb0db083 100644 --- a/static/images/docs/diagrams/timestamp.svg +++ b/static/images/docs/diagrams/timestamp.svg @@ -1 +1,52 @@ -CREATEsomeCreateTableStatementtimestamp(columnName) \ No newline at end of file + + + + + + + + + CREATE + + + someCreateTableStatement + + timestamp + + + ( + + + columnName + + ) + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/timestampExact.svg b/static/images/docs/diagrams/timestampExact.svg deleted file mode 100644 index ea944aa6f..000000000 --- a/static/images/docs/diagrams/timestampExact.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - WHERE - - - column - - = - - - timestamp - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/timestampExplicitRange.svg b/static/images/docs/diagrams/timestampExplicitRange.svg deleted file mode 100644 index 4a7ee29d2..000000000 --- a/static/images/docs/diagrams/timestampExplicitRange.svg +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - WHERE - - - timestamp - - IN - - - ( - - - lower_bound - - , - - - upper_bound - - ) - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/timestampInSearch.svg b/static/images/docs/diagrams/timestampInSearch.svg deleted file mode 100644 index 3582b33c5..000000000 --- a/static/images/docs/diagrams/timestampInSearch.svg +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - WHERE - - - timestampColumn - - IN - - - ( - - - 'timestamp1' - - - ; - - - 'timestamp2' - - - ) - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/timestampIntervalSearch.svg b/static/images/docs/diagrams/timestampIntervalSearch.svg deleted file mode 100644 index 23884431e..000000000 --- a/static/images/docs/diagrams/timestampIntervalSearch.svg +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - WHERE - - - timestampColumn - - IN - - - ' - - - timestamp - - ; - - - multiplier - - - s - - - m - - - h - - - d - - - M - - - y - - ; - - - occurrence - - - s - - - m - - - h - - - d - - - M - - - y - - ; - - - repetition - - ' - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/timestampPartial.svg b/static/images/docs/diagrams/timestampPartial.svg deleted file mode 100644 index ba5fa4d52..000000000 --- a/static/images/docs/diagrams/timestampPartial.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - WHERE - - - timestampColumn - - IN - - - yyyy - - - yyyy-MM - - - YYYY-MM-dd - - - yyyy-MM-ddThh - - - yyyy-MM-ddThh:mm - - - yyyy-MM-ddThh:mm:ss - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/timestampSearch.svg b/static/images/docs/diagrams/timestampSearch.svg deleted file mode 100644 index 3ebd783ee..000000000 --- a/static/images/docs/diagrams/timestampSearch.svg +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - WHERE - - - timestampColumn - - = - - - > - - - < - - - >= - - - <= - - - ' - - - timestamp - - ' - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/typeDef.svg b/static/images/docs/diagrams/typeDef.svg deleted file mode 100644 index c0301dd23..000000000 --- a/static/images/docs/diagrams/typeDef.svg +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - boolean - - - byte - - - short - - - char - - - int - - - float - - - symbol - - - CAPACITY - - - distinctValueEstimate - - CACHE - - - NOCACHE - - - inlineIndexDef - - varchar - - - string - - - long - - - date - - - timestamp - - - double - - - binary - - - long256 - - - geohash(<size>) - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/unassignServiceAccount.svg b/static/images/docs/diagrams/unassignServiceAccount.svg deleted file mode 100644 index 4b3ac5b97..000000000 --- a/static/images/docs/diagrams/unassignServiceAccount.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - UNASSIGN - - - SERVICE - - - ACCOUNT - - - serviceAccount - - FROM - - - userOrGroup - - , - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/update.svg b/static/images/docs/diagrams/update.svg index abfbff034..1b550106f 100644 --- a/static/images/docs/diagrams/update.svg +++ b/static/images/docs/diagrams/update.svg @@ -1,4 +1,4 @@ - + - - - - - UPDATE - - tableName - - - SET - - - columnName - - = - - - expression - - - , - - - + + + + + UPDATE + + tableName + + + SET + + + columnName + + = + + + expression + + + , + + + FROM + + joinTable1 + + + JOIN + + joinTable2 + + + ON + + joinCondition2 + + + WHERE + + filter + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/where.svg b/static/images/docs/diagrams/where.svg index 119abcafd..0c78ab0e4 100644 --- a/static/images/docs/diagrams/where.svg +++ b/static/images/docs/diagrams/where.svg @@ -1 +1,51 @@ -select_statement(query)whereboolean_expr \ No newline at end of file + + + + + + + + + selectStatement + + ( + + + query + + ) + + + WHERE + + + boolean_expr + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/whereBoolean.svg b/static/images/docs/diagrams/whereBoolean.svg index e0dee07a9..a4a68a07a 100644 --- a/static/images/docs/diagrams/whereBoolean.svg +++ b/static/images/docs/diagrams/whereBoolean.svg @@ -1 +1,44 @@ -WHERENOTcolumnName \ No newline at end of file + + + + + + + + + WHERE + + + NOT + + + columnName + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/whereComplex.svg b/static/images/docs/diagrams/whereComplex.svg index fca94ea99..19d0032ac 100644 --- a/static/images/docs/diagrams/whereComplex.svg +++ b/static/images/docs/diagrams/whereComplex.svg @@ -1 +1,56 @@ -WHERE(ANDORNOTboolean) \ No newline at end of file + + + + + + + + + WHERE + + + ( + + + AND + + + OR + + + NOT + + + boolean + + ) + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/whereEqDoublePrecision.svg b/static/images/docs/diagrams/whereEqDoublePrecision.svg deleted file mode 100644 index 6ae5f745b..000000000 --- a/static/images/docs/diagrams/whereEqDoublePrecision.svg +++ /dev/null @@ -1 +0,0 @@ -WHEREeq(column,value,precision) \ No newline at end of file diff --git a/static/images/docs/diagrams/whereEqDoubleProximityPrecision.svg b/static/images/docs/diagrams/whereEqDoubleProximityPrecision.svg deleted file mode 100644 index 5d7255e50..000000000 --- a/static/images/docs/diagrams/whereEqDoubleProximityPrecision.svg +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - WHERE - - - eq - - - ( - - - column - - , - - - value - - , - - - precision - - ) - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/whereExactString.svg b/static/images/docs/diagrams/whereExactString.svg index 5becfb947..e01ac1928 100644 --- a/static/images/docs/diagrams/whereExactString.svg +++ b/static/images/docs/diagrams/whereExactString.svg @@ -1 +1,52 @@ -WHEREcolumn='string' \ No newline at end of file + + + + + + + + + WHERE + + + column + + = + + + ' + + + string + + ' + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/whereListIn.svg b/static/images/docs/diagrams/whereListIn.svg index 11927308e..10454ca4f 100644 --- a/static/images/docs/diagrams/whereListIn.svg +++ b/static/images/docs/diagrams/whereListIn.svg @@ -1 +1,58 @@ -WHERENOTcolumnNamein(string,) \ No newline at end of file + + + + + + + + + WHERE + + + NOT + + + columnName + + in + + + ( + + + string + + , + + + ) + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/whereRegexMatch.svg b/static/images/docs/diagrams/whereRegexMatch.svg index d9dd6b92b..d170514c4 100644 --- a/static/images/docs/diagrams/whereRegexMatch.svg +++ b/static/images/docs/diagrams/whereRegexMatch.svg @@ -1 +1,46 @@ -WHEREcolumn~regex \ No newline at end of file + + + + + + + + + WHERE + + + column + + ~ + + + regex + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/whereRegexNotMatch.svg b/static/images/docs/diagrams/whereRegexNotMatch.svg index e9ebcbeec..7814bd33c 100644 --- a/static/images/docs/diagrams/whereRegexNotMatch.svg +++ b/static/images/docs/diagrams/whereRegexNotMatch.svg @@ -1 +1,55 @@ -WHERE!~(column;regex) \ No newline at end of file + + + + + + + + + WHERE + + + ~= + + + ( + + + column + + ; + + + regex + + ) + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/whereStringNotMatch.svg b/static/images/docs/diagrams/whereStringNotMatch.svg index f4ac08ec1..e92ae3c60 100644 --- a/static/images/docs/diagrams/whereStringNotMatch.svg +++ b/static/images/docs/diagrams/whereStringNotMatch.svg @@ -1 +1,52 @@ -WHEREcolumn!='string' \ No newline at end of file + + + + + + + + + WHERE + + + column + + != + + + ' + + + string + + ' + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/whereTimestampExact.svg b/static/images/docs/diagrams/whereTimestampExact.svg index af1124562..ea944aa6f 100644 --- a/static/images/docs/diagrams/whereTimestampExact.svg +++ b/static/images/docs/diagrams/whereTimestampExact.svg @@ -1 +1,46 @@ -WHEREcolumn=timestamp \ No newline at end of file + + + + + + + + + WHERE + + + column + + = + + + timestamp + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/whereTimestampIntervalSearch.svg b/static/images/docs/diagrams/whereTimestampIntervalSearch.svg index 5cbc36e94..dfb35abab 100644 --- a/static/images/docs/diagrams/whereTimestampIntervalSearch.svg +++ b/static/images/docs/diagrams/whereTimestampIntervalSearch.svg @@ -1 +1,103 @@ -WHEREtimestampColumnIN'timestamp;modifiersmhdMy;intervalsmhdMy;repetition' \ No newline at end of file + + + + + + + + + WHERE + + + timestampColumn + + IN + + + ' + + + timestamp + + ; + + + modifier + + + s + + + m + + + h + + + d + + + M + + + y + + ; + + + interval + + + s + + + m + + + h + + + d + + + M + + + y + + ; + + + repetition + + ' + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/whereTimestampPartial.svg b/static/images/docs/diagrams/whereTimestampPartial.svg index a6eeb8c2d..ba5fa4d52 100644 --- a/static/images/docs/diagrams/whereTimestampPartial.svg +++ b/static/images/docs/diagrams/whereTimestampPartial.svg @@ -1 +1,62 @@ -WHEREtimestampColumnINyyyyyyyy-MMYYYY-MM-ddyyyy-MM-ddThhyyyy-MM-ddThh:mmyyyy-MM-ddThh:mm:ss \ No newline at end of file + + + + + + + + + WHERE + + + timestampColumn + + IN + + + yyyy + + + yyyy-MM + + + YYYY-MM-dd + + + yyyy-MM-ddThh + + + yyyy-MM-ddThh:mm + + + yyyy-MM-ddThh:mm:ss + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/whereTimestampRange.svg b/static/images/docs/diagrams/whereTimestampRange.svg deleted file mode 100644 index bca777b8e..000000000 --- a/static/images/docs/diagrams/whereTimestampRange.svg +++ /dev/null @@ -1 +0,0 @@ -WHEREtimestampin(lower_bound,upper_bound) \ No newline at end of file diff --git a/static/images/docs/diagrams/windowFunction.svg b/static/images/docs/diagrams/windowFunction.svg deleted file mode 100644 index 3c746ce61..000000000 --- a/static/images/docs/diagrams/windowFunction.svg +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - functionName - - OVER - - - ( - - - PARTITION - - - BY - - - columnName - - , - - - ORDER - - - BY - - - columnName - - ASC - - - DESC - - - , - - - RANGE - - - ROWS - - - UNBOUNDED - - - offset - - PRECEDING - - - CURRENT - - - ROW - - - BETWEEN - - - UNBOUNDED - - - offset - - PRECEDING - - - CURRENT - - - ROW - - - AND - - - offset - - PRECEDING - - - CURRENT - - - ROW - - - EXCLUDE - - - CURRENT - - - ROW - - - NO - - - OTHERS - - - ) - - - - \ No newline at end of file diff --git a/static/images/docs/diagrams/withAsInsert.svg b/static/images/docs/diagrams/withAsInsert.svg index ff4e54201..cba7937de 100644 --- a/static/images/docs/diagrams/withAsInsert.svg +++ b/static/images/docs/diagrams/withAsInsert.svg @@ -1,183 +1,87 @@ - - - - - - WITH - - - - subQueryName - - - - AS - - - ( - - - - subQuery - - - - ) - - - , - - - INSERT - - - ATOMIC - - - BATCH - - - - number - - - - o3MaxLag - - - - numberWithUnit - - - - INTO - - - - tableName - - - - SELECT - - - - queryDef - - - - - subQueryName - - - - ; - - - - + + + + + WITH + + + subQueryName + + AS + + + ( + + + subQuery + + ) + + + , + + + INSERT + + + ATOMIC + + + BATCH + + + number + + o3MaxLag + + + numberWithUnit + + INTO + + + tableName + + SELECT + + + queryDef + + + subQueryName + + ; + + + + \ No newline at end of file diff --git a/static/images/docs/diagrams/withAsInsertCommitLag.svg b/static/images/docs/diagrams/withAsInsertCommitLag.svg deleted file mode 100644 index 7faf601fe..000000000 --- a/static/images/docs/diagrams/withAsInsertCommitLag.svg +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - WITH - - - subQueryName - - AS - - - ( - - - subQuery - - ) - - - , - - - INSERT - - - batch - - - batchCount - - commitLag - - - n - - us - - - s - - - m - - - h - - - d - - - INTO - - - tableName - - SELECT - - - queryDef - - - subQueryName - - ; - - - - \ No newline at end of file From dfc96cc91e51fccddd88a021a7c0b3bd803df484 Mon Sep 17 00:00:00 2001 From: emrberk Date: Thu, 9 Oct 2025 02:16:34 +0300 Subject: [PATCH 2/5] action test --- src/theme/RemoteRepoExample/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/theme/RemoteRepoExample/index.tsx b/src/theme/RemoteRepoExample/index.tsx index 6fb1a5df8..220ed28e2 100644 --- a/src/theme/RemoteRepoExample/index.tsx +++ b/src/theme/RemoteRepoExample/index.tsx @@ -50,6 +50,7 @@ type Props = { /// /// The code itself is fetched at build time using the `remote-repo-example` /// plugin. + export const RemoteRepoExample = ({ name, lang, From 5734606a1b9dce20edd36d62df0b0422a4d288c8 Mon Sep 17 00:00:00 2001 From: emrberk Date: Thu, 9 Oct 2025 15:44:08 +0300 Subject: [PATCH 3/5] revisions on conversion --- plugins/raw-markdown/convert-components.js | 167 ++++++++++++--------- plugins/raw-markdown/index.js | 4 +- scripts/generate-reference-full.js | 4 +- 3 files changed, 101 insertions(+), 74 deletions(-) diff --git a/plugins/raw-markdown/convert-components.js b/plugins/raw-markdown/convert-components.js index 7c741d1fe..2dec1722c 100644 --- a/plugins/raw-markdown/convert-components.js +++ b/plugins/raw-markdown/convert-components.js @@ -22,18 +22,64 @@ function parseProps(propsString) { } /** - * Converts components to bold alt text - * Example: -> **test** + * + * @param {string} content - The content to search + * @param {string} componentName - Name of the component (e.g., "Screenshot") + * @returns {Array} Array of match objects with { props, children, fullMatch, index } */ -function convertScreenshot(content) { - const screenshotRegex = /]*?)(?:\/?>|>\s*<\/Screenshot>)/gs +function matchComponent(content, componentName) { + const matches = [] - return content.replace(screenshotRegex, (match, propsString) => { - const props = parseProps(propsString) - if (props.alt) { - return `\n\n**${props.alt}**\n\n` - } - return "\n\n**[Screenshot]**\n\n" + // Universal regex that matches: + // ) (self-closing /> OR open-tag > children ) + // Uses [\s\S]*? to match props across newlines (non-greedy to stop at /> or >) + const pattern = `<${componentName}([\\s\\S]*?)(?:\\/>|>([\\s\\S]*?)<\\/${componentName}>)` + const regex = new RegExp(pattern, 'g') + + let match + + while ((match = regex.exec(content)) !== null) { + matches.push({ + fullMatch: match[0], + propsString: match[1] ? match[1].trim() : '', + props: parseProps(match[1] ? match[1].trim() : ''), + children: match[2] || '', // undefined if self-closing + index: match.index, + isSelfClosing: !match[2] && match[2] !== '' + }) + } + + return matches +} + +/** + * Replace component occurrences using the unified matcher + * + * @param {string} content - The content to process + * @param {string} componentName - Name of the component + * @param {function} replacer - Function that receives match object and returns replacement string + * @returns {string} Processed content + */ +function replaceComponent(content, componentName, replacer) { + const matches = matchComponent(content, componentName) + + // Replace from end to start to maintain correct indices + let result = content + for (let i = matches.length - 1; i >= 0; i--) { + const match = matches[i] + const replacement = replacer(match) + result = result.substring(0, match.index) + replacement + result.substring(match.index + match.fullMatch.length) + } + + return result +} + +/** + * Removes components + */ +function convertScreenshot(content) { + return replaceComponent(content, 'Screenshot', (_) => { + return "" }) } @@ -41,12 +87,9 @@ function convertScreenshot(content) { * Converts components to markdown code blocks */ function convertCodeBlock(content) { - const codeBlockRegex = /]*?)>([\s\S]*?)<\/CodeBlock>/g - - return content.replace(codeBlockRegex, (match, propsString, children) => { - const props = parseProps(propsString) - const language = props.language || "" - const trimmedCode = children.trim() + return replaceComponent(content, 'CodeBlock', (match) => { + const language = match.props.language || match.props.className?.replace('language-', '') || "" + const trimmedCode = match.children.trim() return `\n\n\`\`\`${language}\n${trimmedCode}\n\`\`\`\n\n` }) } @@ -55,12 +98,14 @@ function convertCodeBlock(content) { * Converts components to markdown links */ function convertDocButton(content) { - const docButtonRegex = /]*?)>([\s\S]*?)<\/DocButton>/g - - return content.replace(docButtonRegex, (match, propsString, children) => { - const props = parseProps(propsString) - const href = props.href || props.to || "#" - const text = children.trim() + return replaceComponent(content, 'DocButton', (match) => { + const href = match.props.href || match.props.to || "#" + // Strip JSX tags like <>, , and other HTML/JSX elements from children + const text = match.children + .trim() + .replace(/<\/?>/g, '') // Remove React fragments <> and + .replace(/<[^>]+>/g, '') // Remove other HTML/JSX tags + .trim() return `[${text}](${href})` }) } @@ -69,13 +114,11 @@ function convertDocButton(content) { * Converts and to markdown table */ function convertTabs(content) { - const tabsRegex = /([\s\S]*?)<\/Tabs>/g - - return content.replace(tabsRegex, (match, propsString, children) => { + return replaceComponent(content, 'Tabs', (match) => { // Extract values array from props (can span multiple lines) - const valuesMatch = propsString.match(/values=\{(\[[\s\S]*?\])\}/s) + const valuesMatch = match.propsString.match(/values=\{(\[[\s\S]*?\])\}/s) if (!valuesMatch) { - return match // Return original if can't parse + return match.fullMatch // Return original if can't parse } let valuesArray @@ -88,7 +131,7 @@ function convertTabs(content) { valuesArray = JSON.parse(valuesStr) } catch (e) { console.warn("[convert-components] Failed to parse Tabs values:", e.message) - return match + return match.fullMatch } // Extract TabItem contents @@ -96,7 +139,7 @@ function convertTabs(content) { const tabItemRegex = /]*?>([\s\S]*?)<\/TabItem>/g let tabMatch - while ((tabMatch = tabItemRegex.exec(children)) !== null) { + while ((tabMatch = tabItemRegex.exec(match.children)) !== null) { const value = tabMatch[1] const content = tabMatch[2].trim() tabItems.push({ value, content }) @@ -134,16 +177,12 @@ function convertConfigTable(content, docsPath) { importMap.set(varName, unescapedPath) } - const configTableRegex = /]*?)\/>/g - - return content.replace(configTableRegex, (match, propsString) => { - const props = parseProps(propsString) - + return replaceComponent(content, 'ConfigTable', (match) => { // ConfigTable typically uses a rows prop pointing to JSON data - if (props.rows) { + if (match.props.rows) { try { // Get the import path for this variable - const importPath = importMap.get(props.rows) + const importPath = importMap.get(match.props.rows) if (importPath) { // Resolve the path relative to the markdown file's directory const configPath = path.join(docsPath, importPath) @@ -222,22 +261,25 @@ async function fetchReleaseVersion() { } function convertInterpolateReleaseData(content, releaseVersion) { - // Match (self-closing) - // Extract what renderText returns and replace {release.name} with version - const interpolateRegex = //g - - return content.replace(interpolateRegex, (match) => { - // Extract everything inside renderText={(...) => ( ... )} - // Match from the opening paren after => to the closing paren before )} - const renderTextMatch = match.match(/renderText=\{[^(]*\([^)]*\)\s*=>\s*\(([\s\S]*?)\)\s*\}/); + return replaceComponent(content, 'InterpolateReleaseData', (match) => { + // Try two patterns: + // 1. Arrow function with implicit return: (release) => (...) + // 2. Arrow function with explicit return: (release) => { return (...) } + let renderTextMatch = match.fullMatch.match(/renderText=\{[^(]*\([^)]*\)\s*=>\s*\(([\s\S]*?)\)\s*\}/); + + if (!renderTextMatch) { + // Try pattern with { return (...) } + renderTextMatch = match.fullMatch.match(/renderText=\{[^(]*\([^)]*\)\s*=>\s*\{\s*return\s*\(([\s\S]*?)\)\s*\}\s*\}/); + } if (renderTextMatch) { // Extract the JSX content being returned let extracted = renderTextMatch[1].trim(); - // Replace ${release.name} with the actual version (note the $ before the {) - extracted = extracted.replace(/\$\{release\.name\}/g, releaseVersion); - extracted = extracted.replace(/\$\{release\.tag_name\}/g, releaseVersion); + // Replace template literal placeholders with actual version + // Handles both ${release.name} (with $) and {release.name} (without $ inside template literals) + extracted = extracted.replace(/\$?\{release\.name\}/g, releaseVersion); + extracted = extracted.replace(/\$?\{release\.tag_name\}/g, releaseVersion); // Remove JSX template literal syntax: {`...`} becomes just the content extracted = extracted.replace(/\{`/g, ''); @@ -307,13 +349,9 @@ function convertRailroadDiagrams(content, docsPath) { * @param {object} repoExamples - Repository examples data from remote-repo-example plugin */ function convertRemoteRepoExample(content, repoExamples = {}) { - // Use [\s\S]*? to match across multiple lines - const remoteRepoRegex = //g - - return content.replace(remoteRepoRegex, (match, propsString) => { - const props = parseProps(propsString) - const name = props.name || 'unknown' - const lang = props.lang || 'text' + return replaceComponent(content, 'RemoteRepoExample', (match) => { + const name = match.props.name || 'unknown' + const lang = match.props.lang || 'text' const id = `${name}/${lang}` // Get the example from plugin data @@ -328,7 +366,7 @@ function convertRemoteRepoExample(content, repoExamples = {}) { let output = '\n\n' // Add header if it exists and header prop is not false - if (props.header !== 'false' && example.header) { + if (match.props.header !== 'false' && example.header) { output += `${example.header}\n\n` } @@ -383,12 +421,8 @@ const clients = [ }, ] function convertILPClientsTable(content) { - // Use [\s\S]*? to match across multiple lines - const ilpClientsRegex = //g - - return content.replace(ilpClientsRegex, (match, propsString) => { - const props = parseProps(propsString) - const language = props.language + return replaceComponent(content, 'ILPClientsTable', (match) => { + const language = match.props.language // Filter by language if specified const filteredClients = language @@ -573,7 +607,7 @@ function prependFrontmatter(content, frontmatter, includeTitle = true) { * @param {string} content - The processed markdown content * @returns {string} Cleaned markdown */ -function cleanForLLM(content) { +function normalizeNewLines(content) { return content .replace(/\n{3,}/g, '\n\n') // Normalize multiple newlines .trim() @@ -581,15 +615,8 @@ function cleanForLLM(content) { module.exports = { convertAllComponents, - convertScreenshot, - convertDocButton, - convertCodeBlock, - convertTabs, - convertConfigTable, - convertInterpolateReleaseData, - fetchReleaseVersion, bumpHeadings, - cleanForLLM, + normalizeNewLines, removeImports, processPartialImports, prependFrontmatter, diff --git a/plugins/raw-markdown/index.js b/plugins/raw-markdown/index.js index ad8d73f87..ed1c05673 100644 --- a/plugins/raw-markdown/index.js +++ b/plugins/raw-markdown/index.js @@ -6,7 +6,7 @@ const { removeImports, processPartialImports, prependFrontmatter, - cleanForLLM, + normalizeNewLines, } = require("./convert-components") module.exports = () => ({ @@ -73,7 +73,7 @@ module.exports = () => ({ processedContent = removeImports(processedContent) // Clean and normalize - processedContent = cleanForLLM(processedContent) + "\n" + processedContent = normalizeNewLines(processedContent) + "\n" let urlPath diff --git a/scripts/generate-reference-full.js b/scripts/generate-reference-full.js index 68538f14c..3049fd161 100644 --- a/scripts/generate-reference-full.js +++ b/scripts/generate-reference-full.js @@ -4,7 +4,7 @@ const yaml = require('js-yaml') const { convertAllComponents, bumpHeadings, - cleanForLLM, + normalizeNewLines, removeImports, processPartialImports, prependFrontmatter, @@ -88,7 +88,7 @@ async function extractFrontmatterAndContent(raw, filePath) { processedContent = removeImports(processedContent) // Clean and normalize - processedContent = cleanForLLM(processedContent) + processedContent = normalizeNewLines(processedContent) // Bump heading levels for proper hierarchy in combined document // H1 (title) becomes H2, H2 becomes H3, etc. From 30c88e9d2c4eddbfb95ce661166a971f57335149 Mon Sep 17 00:00:00 2001 From: emrberk Date: Tue, 14 Oct 2025 16:57:24 +0300 Subject: [PATCH 4/5] convert Clients, use shared objects --- plugins/raw-markdown/convert-components.js | 70 +++++------- shared/clients.json | 122 ++++++++++++++++++++ shared/ilp_clients.json | 49 ++++++++ src/components/Clients/index.tsx | 126 +-------------------- src/theme/ILPClientsTable/index.tsx | 51 +-------- 5 files changed, 204 insertions(+), 214 deletions(-) create mode 100644 shared/clients.json create mode 100644 shared/ilp_clients.json diff --git a/plugins/raw-markdown/convert-components.js b/plugins/raw-markdown/convert-components.js index 2dec1722c..59606b588 100644 --- a/plugins/raw-markdown/convert-components.js +++ b/plugins/raw-markdown/convert-components.js @@ -1,5 +1,7 @@ const fs = require("fs") const path = require("path") +const clients = require("../../shared/clients.json") +const ilpClients = require("../../shared/ilp_clients.json") /** * Parses JSX props from a string like: alt="test" height={300} src="..." @@ -380,54 +382,14 @@ function convertRemoteRepoExample(content, repoExamples = {}) { /** * Converts to markdown list with links */ -const clients = [ - { - label: "Python", - docsUrl: "https://py-questdb-client.readthedocs.io/en/latest/", - sourceUrl: "https://github.com/questdb/py-questdb-client", - }, - { - label: "NodeJS", - docsUrl: "https://questdb.github.io/nodejs-questdb-client", - sourceUrl: "https://github.com/questdb/nodejs-questdb-client", - }, - { - label: ".NET", - sourceUrl: "https://github.com/questdb/net-questdb-client", - }, - { - label: "Java", - docsUrl: "/docs/reference/clients/java_ilp/", - }, - { - label: "C", - docsUrl: "https://github.com/questdb/c-questdb-client/blob/main/doc/C.md", - sourceUrl: "https://github.com/questdb/c-questdb-client", - }, - { - label: "C++", - docsUrl: "https://github.com/questdb/c-questdb-client/blob/main/doc/CPP.md", - sourceUrl: "https://github.com/questdb/c-questdb-client", - }, - { - label: "Golang", - docsUrl: "https://pkg.go.dev/github.com/questdb/go-questdb-client/", - sourceUrl: "https://github.com/questdb/go-questdb-client/", - }, - { - label: "Rust", - docsUrl: "https://docs.rs/crate/questdb-rs/latest", - sourceUrl: "https://github.com/questdb/c-questdb-client", - }, -] function convertILPClientsTable(content) { return replaceComponent(content, 'ILPClientsTable', (match) => { const language = match.props.language // Filter by language if specified const filteredClients = language - ? clients.filter(c => c.label === language) - : clients + ? ilpClients.filter(c => c.label === language) + : ilpClients // Build markdown list let markdown = '\n\n' @@ -449,6 +411,29 @@ function convertILPClientsTable(content) { }) } +function convertClients(content) { + return replaceComponent(content, 'Clients', (match) => { + const showProtocol = match.props.showProtocol + const filteredClients = showProtocol + ? clients.filter(c => c.protocol === showProtocol) + : clients + const protocols = showProtocol ? new Set([showProtocol]) : new Set(filteredClients.map(c => c.protocol)) + + let markdown = '\n\n' + + for (const protocol of protocols) { + markdown += `**${protocol} Clients**\n\n` + + for (const client of filteredClients.filter(c => c.protocol === protocol)) { + markdown += `- [${client.name}](${client.href}): ${client.description}\n` + } + markdown += '\n\n' + } + + return markdown + }) +} + /** * Main function to convert all components in content * @param {string} content - The markdown content @@ -466,6 +451,7 @@ async function convertAllComponents(content, currentFileDir, docsRoot, repoExamp processed = convertInterpolateReleaseData(processed, releaseVersion) processed = convertRemoteRepoExample(processed, repoExamples) processed = convertILPClientsTable(processed) + processed = convertClients(processed) processed = convertScreenshot(processed) processed = convertDocButton(processed) processed = convertCodeBlock(processed) diff --git a/shared/clients.json b/shared/clients.json new file mode 100644 index 000000000..333a01531 --- /dev/null +++ b/shared/clients.json @@ -0,0 +1,122 @@ +[ + { + "href": "/docs/clients/ingest-c-and-cpp", + "name": "C & C++", + "description": + "High-performance client for systems programming and embedded applications.", + "logo": "/images/logos/cplusplus.svg", + "protocol": "ILP" + }, + { + "href": "/docs/clients/ingest-dotnet", + "name": ".NET", + "description": + "Cross-platform client for building applications with .NET technologies.", + "logo": "/images/logos/dotnet.svg", + "protocol": "ILP" + }, + { + "href": "/docs/pgwire/c-sharp", + "name": ".NET", + "description": + "Cross-platform clients for building applications with .NET technologies.", + "logo": "/images/logos/dotnet.svg", + "protocol": "PGWire" + }, + { + "href": "/docs/clients/ingest-go", + "name": "Go", + "description": + "An open-source programming language supported by Google with built-in concurrency.", + "logo": "/images/logos/go.svg", + "protocol": "ILP" + }, + { + "href": "/docs/pgwire/go", + "name": "Go", + "description": + "An open-source programming language supported by Google with built-in concurrency.", + "logo": "/images/logos/go.svg", + "protocol": "PGWire" + }, + { + "href": "/docs/clients/java_ilp", + "name": "Java", + "description": + "Platform-independent client for enterprise applications and Android development.", + "logo": "/images/logos/java.svg", + "protocol": "ILP" + }, + { + "href": "/docs/pgwire/java", + "name": "Java", + "description": + "Platform-independent clients for enterprise applications and Android development.", + "logo": "/images/logos/java.svg", + "protocol": "PGWire" + }, + { + "href": "/docs/clients/ingest-node", + "name": "Node.js", + "description": + "Node.js® is an open-source, cross-platform JavaScript runtime environment.", + "logo": "/images/logos/nodejs-light.svg", + "protocol": "ILP" + }, + { + "href": "/docs/pgwire/javascript", + "name": "Node.js", + "description": + "Node.js® is an open-source, cross-platform JavaScript runtime environment.", + "logo": "/images/logos/nodejs-light.svg", + "protocol": "PGWire" + }, + { + "href": "/docs/clients/ingest-python", + "name": "Python", + "description": + "Python is a programming language that lets you work quickly and integrate systems more effectively.", + "logo": "/images/logos/python.svg", + "protocol": "ILP" + }, + { + "href": "/docs/pgwire/python/", + "name": "Python", + "description": + "Python is a programming language that lets you work quickly and integrate systems more effectively.", + "logo": "/images/logos/python.svg", + "protocol": "PGWire" + }, + { + "href": "/docs/clients/ingest-rust", + "name": "Rust", + "description": + "Systems programming language focused on safety, speed, and concurrency.", + "logo": "/images/logos/rust.svg", + "protocol": "ILP" + }, + { + "href": "/docs/pgwire/rust", + "name": "Rust", + "description": + "Systems programming language focused on safety, speed, and concurrency.", + "logo": "/images/logos/rust.svg", + "protocol": "PGWire" + }, + { + "href": "/docs/pgwire/php", + "name": "PHP", + "description": + "PHP is a popular general-purpose scripting language that is especially suited to web development.", + "logo": "/images/logos/php.svg", + "protocol": "PGWire" + }, + { + "href": "/docs/pgwire/rpostgres", + "name": "R", + "description": + "R is a programming language and free software environment for statistical computing and graphics supported by the R Foundation for Statistical Computing.", + "logo": "/images/logos/r.svg", + "protocol": "PGWire" + } +] diff --git a/shared/ilp_clients.json b/shared/ilp_clients.json new file mode 100644 index 000000000..13026f28b --- /dev/null +++ b/shared/ilp_clients.json @@ -0,0 +1,49 @@ +[ + { + "label": "Python", + "logoSrc": "/images/logos/python.svg", + "docsUrl": "https://py-questdb-client.readthedocs.io/en/latest/", + "sourceUrl": "https://github.com/questdb/py-questdb-client" + }, + { + "label": "NodeJS", + "logoSrc": "/images/logos/nodejs-light.svg", + "lightThemeLogoSrc": "/images/logos/jsIconGreen.svg", + "docsUrl": "https://questdb.github.io/nodejs-questdb-client", + "sourceUrl": "https://github.com/questdb/nodejs-questdb-client" + }, + { + "label": ".NET", + "logoSrc": "/images/logos/dotnet.svg", + "sourceUrl": "https://github.com/questdb/net-questdb-client" + }, + { + "label": "Java", + "docsUrl": "/docs/reference/clients/java_ilp/", + "logoSrc": "/images/logos/java.svg" + }, + { + "label": "C", + "logoSrc": "/images/logos/c.svg", + "docsUrl": "https://github.com/questdb/c-questdb-client/blob/main/doc/C.md", + "sourceUrl": "https://github.com/questdb/c-questdb-client" + }, + { + "label": "C++", + "logoSrc": "/images/logos/cplusplus.svg", + "docsUrl": "https://github.com/questdb/c-questdb-client/blob/main/doc/CPP.md", + "sourceUrl": "https://github.com/questdb/c-questdb-client" + }, + { + "label": "Golang", + "logoSrc": "/images/logos/go.svg", + "docsUrl": "https://pkg.go.dev/github.com/questdb/go-questdb-client/", + "sourceUrl": "https://github.com/questdb/go-questdb-client/" + }, + { + "label": "Rust", + "logoSrc": "/images/logos/rust.svg", + "docsUrl": "https://docs.rs/crate/questdb-rs/latest", + "sourceUrl": "https://github.com/questdb/c-questdb-client" + } +] diff --git a/src/components/Clients/index.tsx b/src/components/Clients/index.tsx index edd9a801f..654b928fc 100644 --- a/src/components/Clients/index.tsx +++ b/src/components/Clients/index.tsx @@ -1,5 +1,6 @@ import { DocButton } from '../DocButton'; // Assuming DocButton is in the parent directory import useBaseUrl from '@docusaurus/useBaseUrl'; +import clients from '../../../shared/clients.json'; interface Client { href: string; @@ -9,133 +10,12 @@ interface Client { protocol: 'ILP' | 'PGWire'; // Protocol type } -const clientsData: Client[] = [ - { - href: '/docs/clients/ingest-c-and-cpp', - name: 'C & C++', - description: - 'High-performance client for systems programming and embedded applications.', - logo: '/images/logos/cplusplus.svg', - protocol: 'ILP', - }, - { - href: '/docs/clients/ingest-dotnet', - name: '.NET', - description: - 'Cross-platform client for building applications with .NET technologies.', - logo: '/images/logos/dotnet.svg', - protocol: 'ILP', - }, - { - href: '/docs/pgwire/c-sharp', - name: '.NET', - description: - 'Cross-platform clients for building applications with .NET technologies.', - logo: '/images/logos/dotnet.svg', - protocol: 'PGWire', - }, - { - href: '/docs/clients/ingest-go', - name: 'Go', - description: - 'An open-source programming language supported by Google with built-in concurrency.', - logo: '/images/logos/go.svg', - protocol: 'ILP', - }, - { - href: '/docs/pgwire/go', - name: 'Go', - description: - 'An open-source programming language supported by Google with built-in concurrency.', - logo: '/images/logos/go.svg', - protocol: 'PGWire', - }, - { - href: '/docs/clients/java_ilp', - name: 'Java', - description: - 'Platform-independent client for enterprise applications and Android development.', - logo: '/images/logos/java.svg', - protocol: 'ILP', - }, - { - href: '/docs/pgwire/java', - name: 'Java', - description: - 'Platform-independent clients for enterprise applications and Android development.', - logo: '/images/logos/java.svg', - protocol: 'PGWire', - }, - { - href: '/docs/clients/ingest-node', - name: 'Node.js', - description: - 'Node.js® is an open-source, cross-platform JavaScript runtime environment.', - logo: '/images/logos/nodejs-light.svg', - protocol: 'ILP', - }, - { - href: '/docs/pgwire/javascript', - name: 'Node.js', - description: - 'Node.js® is an open-source, cross-platform JavaScript runtime environment.', - logo: '/images/logos/nodejs-light.svg', - protocol: 'PGWire', - }, - { - href: '/docs/clients/ingest-python', - name: 'Python', - description: - 'Python is a programming language that lets you work quickly and integrate systems more effectively.', - logo: '/images/logos/python.svg', - protocol: 'ILP', - }, - { - href: '/docs/pgwire/python/', - name: 'Python', - description: - 'Python is a programming language that lets you work quickly and integrate systems more effectively.', - logo: '/images/logos/python.svg', - protocol: 'PGWire', - }, - { - href: '/docs/clients/ingest-rust', - name: 'Rust', - description: - 'Systems programming language focused on safety, speed, and concurrency.', - logo: '/images/logos/rust.svg', - protocol: 'ILP', - }, - { - href: '/docs/pgwire/rust', - name: 'Rust', - description: - 'Systems programming language focused on safety, speed, and concurrency.', - logo: '/images/logos/rust.svg', - protocol: 'PGWire', - }, - { - href: '/docs/pgwire/php', - name: 'PHP', - description: - 'PHP is a popular general-purpose scripting language that is especially suited to web development.', - logo: '/images/logos/php.svg', - protocol: 'PGWire', - }, - { - href: '/docs/pgwire/rpostgres', - name: 'R', - description: - 'R is a programming language and free software environment for statistical computing and graphics supported by the R Foundation for Statistical Computing.', - logo: '/images/logos/r.svg', - protocol: 'PGWire', - }, -]; - interface ClientDisplayProps { showProtocol?: 'ILP' | 'PGWire'; } +const clientsData = clients as Client[]; + export function Clients({ showProtocol }: ClientDisplayProps) { const protocolToDisplay = showProtocol || 'ILP'; diff --git a/src/theme/ILPClientsTable/index.tsx b/src/theme/ILPClientsTable/index.tsx index 98ef6d6c4..dca3a0bb0 100644 --- a/src/theme/ILPClientsTable/index.tsx +++ b/src/theme/ILPClientsTable/index.tsx @@ -1,4 +1,5 @@ import useBaseUrl from '@docusaurus/useBaseUrl' +import ilpClients from '../../../shared/ilp_clients.json' import style from "./style.module.css" type Client = { @@ -13,55 +14,7 @@ type ILPClientsTableProps = { language?: string } -const clients: Client[] = [ - { - label: "Python", - logoSrc: "/images/logos/python.svg", - docsUrl: "https://py-questdb-client.readthedocs.io/en/latest/", - sourceUrl: "https://github.com/questdb/py-questdb-client", - }, - { - label: "NodeJS", - logoSrc: "/images/logos/nodejs-light.svg", - lightThemeLogoSrc: "/images/logos/jsIconGreen.svg", - docsUrl: "https://questdb.github.io/nodejs-questdb-client", - sourceUrl: "https://github.com/questdb/nodejs-questdb-client", - }, - { - label: ".NET", - logoSrc: "/images/logos/dotnet.svg", - sourceUrl: "https://github.com/questdb/net-questdb-client", - }, - { - label: "Java", - docsUrl: "/docs/reference/clients/java_ilp/", - logoSrc: "/images/logos/java.svg", - }, - { - label: "C", - logoSrc: "/images/logos/c.svg", - docsUrl: "https://github.com/questdb/c-questdb-client/blob/main/doc/C.md", - sourceUrl: "https://github.com/questdb/c-questdb-client", - }, - { - label: "C++", - logoSrc: "/images/logos/cplusplus.svg", - docsUrl: "https://github.com/questdb/c-questdb-client/blob/main/doc/CPP.md", - sourceUrl: "https://github.com/questdb/c-questdb-client", - }, - { - label: "Golang", - logoSrc: "/images/logos/go.svg", - docsUrl: "https://pkg.go.dev/github.com/questdb/go-questdb-client/", - sourceUrl: "https://github.com/questdb/go-questdb-client/", - }, - { - label: "Rust", - logoSrc: "/images/logos/rust.svg", - docsUrl: "https://docs.rs/crate/questdb-rs/latest", - sourceUrl: "https://github.com/questdb/c-questdb-client", - }, -] +const clients: Client[] = ilpClients as Client[] // @ts-expect-error TS6133 const openInNewTab = (url: string) => ({ From 6f0a7aa2977cec3ceddf5b8cc075ea51a5bbe614 Mon Sep 17 00:00:00 2001 From: emrberk Date: Tue, 14 Oct 2025 17:43:55 +0300 Subject: [PATCH 5/5] remove image references --- plugins/raw-markdown/convert-components.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/raw-markdown/convert-components.js b/plugins/raw-markdown/convert-components.js index 59606b588..15b9581f4 100644 --- a/plugins/raw-markdown/convert-components.js +++ b/plugins/raw-markdown/convert-components.js @@ -85,6 +85,11 @@ function convertScreenshot(content) { }) } +function convertImages(content) { + const imageRegex = /!\[([^\]]*)\]\(([^)]+)\.(svg|png|jpg|jpeg|gif|webp)\)/g + return content.replace(imageRegex, "") +} + /** * Converts components to markdown code blocks */ @@ -458,6 +463,7 @@ async function convertAllComponents(content, currentFileDir, docsRoot, repoExamp processed = convertTabs(processed) processed = convertConfigTable(processed, currentFileDir) processed = convertRailroadDiagrams(processed, docsRoot) + processed = convertImages(processed) return processed }