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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
60 changes: 19 additions & 41 deletions .github/workflows/merge-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ jobs:
env:
DETECTED_VERSION: '${{ steps.latest_version_step.outputs.version }}'
START_PAGE_COMPONENT_NAME: "ivorysql-doc"
START_PAGE_FILE_PATH: "welcome.adoc"
run: |
PLAYBOOK_FILES=("antora-playbook-CN.yml" "antora-playbook-EN.yml")

Expand All @@ -91,7 +90,8 @@ jobs:
echo # Newline for better readability

if [[ -n "$DETECTED_VERSION" ]]; then
NEW_START_PAGE="${START_PAGE_COMPONENT_NAME}::v${DETECTED_VERSION}/${START_PAGE_FILE_PATH}"
# Follow the selected release's start_page in antora.yml.
NEW_START_PAGE="v${DETECTED_VERSION}@${START_PAGE_COMPONENT_NAME}::index.adoc"
yq -i ".site.start_page = \"$NEW_START_PAGE\"" "$PLAYBOOK_FILE"
echo "Updated .site.start_page in $PLAYBOOK_FILE to: $NEW_START_PAGE"
else
Expand Down Expand Up @@ -204,45 +204,6 @@ jobs:
path: www_publish_target
token: ${{ secrets.WEB_TOKEN }}

- name: Ensure web index redirects to latest home
if: matrix.target == 'html'
id: update_web_index
working-directory: ./www_publish_target
env:
LATEST_VERSION: ${{ steps.latest_version_step.outputs.version }}
MERGED_PR_BASE: ${{ inputs.source_branch || github.ref_name }}
run: |
set -euo pipefail

TARGET_BRANCH="v${LATEST_VERSION}"
EXPECTED_PATH="ivorysql-doc/v${LATEST_VERSION}/v${LATEST_VERSION}/welcome.html"

if [[ "${MERGED_PR_BASE}" != "${TARGET_BRANCH}" ]]; then
echo "Base branch ${MERGED_PR_BASE} is not the latest version branch ${TARGET_BRANCH}, skip index redirect check."
echo "index_updated=false" >> "$GITHUB_OUTPUT"
exit 0
fi

UPDATE_NEEDED=false
for lang in cn en; do
FILE_PATH="docs/${lang}/index.html"
if [[ ! -f "${FILE_PATH}" ]]; then
echo "Missing ${FILE_PATH}, cannot update redirect."
continue
fi

if grep -q "${EXPECTED_PATH}" "${FILE_PATH}"; then
echo "${FILE_PATH} already points to latest ${LATEST_VERSION}."
else
# Replace all version segments like vX.Y or vX.Y.Z in href/location/meta/script targets
sed -i -E "s@ivorysql-doc/v[0-9]+(\\.[0-9]+){1,2}/v[0-9]+(\\.[0-9]+){1,2}/welcome\\.html@${EXPECTED_PATH}@g" "${FILE_PATH}"
UPDATE_NEEDED=true
echo "Updated ${FILE_PATH} to latest ${LATEST_VERSION} redirect."
fi
done

echo "index_updated=${UPDATE_NEEDED}" >> "$GITHUB_OUTPUT"

- name: Build English and Chinese websites
if: matrix.target == 'html'
working-directory: ./ivory-doc-builder
Expand All @@ -256,6 +217,23 @@ jobs:
npx antora generate --stacktrace --to-dir "../www_publish_target/docs/${language}" "antora-playbook-html-${language}.yml"
done

- name: Preserve old v6.0 documentation URLs
if: matrix.target == 'html'
working-directory: ./www_publish_target
shell: bash
run: |
# Netlify must redirect even when an older HTML file still exists.
cn_rule='/cn/ivorysql-doc/v6.0/v6.0/* /cn/ivorysql-doc/v6.0/:splat 301!'
en_rule='/en/ivorysql-doc/v6.0/v6.0/* /en/ivorysql-doc/v6.0/:splat 301!'
temporary_redirects="$(mktemp docs/_redirects.XXXXXX)"
{
printf '%s\n' "$cn_rule" "$en_rule"
if [[ -f docs/_redirects ]]; then
awk -v cn="$cn_rule" -v en="$en_rule" '$0 != cn && $0 != en' docs/_redirects
fi
} > "$temporary_redirects"
mv "$temporary_redirects" docs/_redirects

- name: Copy PDF into web repository
if: matrix.target != 'html'
working-directory: ./www_publish_target
Expand Down
2 changes: 1 addition & 1 deletion CN/antora.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: ivorysql-doc
title: 文档中心
version: v6.0
start_page: v6.0/welcome.adoc
start_page: welcome.adoc
asciidoc:
attributes:
source-language: asciidoc@
Expand Down
358 changes: 183 additions & 175 deletions CN/modules/ROOT/nav.adoc

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
== 主节点

=== 安装并启动数据库
yum源快速安装数据库,请参考xref:v6.0/getting-started/quick_start.adoc#从yum源安装ivorysql数据库[从yum源安装ivorysql数据库]。
yum源快速安装数据库,请参考xref:getting-started/quick_start.adoc#从yum源安装ivorysql数据库[从yum源安装ivorysql数据库]。

想要获取更多安装方式,请参考xref:v6.0/installation_guide.adoc[安装指南]。
想要获取更多安装方式,请参考xref:installation_guide.adoc[安装指南]。

[NOTE]
主节点数据库需要安装并**启动**
Expand Down Expand Up @@ -56,9 +56,9 @@ $ pg_ctl restart

== 备节点
=== 安装数据库
Yum源快速安装数据库,请参考xref:v6.0/getting-started/quick_start.adoc#从yum源安装ivorysql数据库[从yum源安装ivorysql数据库]。
Yum源快速安装数据库,请参考xref:getting-started/quick_start.adoc#从yum源安装ivorysql数据库[从yum源安装ivorysql数据库]。

想要获取更多安装方式,请参考xref:v6.0/installation_guide.adoc[安装指南]。
想要获取更多安装方式,请参考xref:installation_guide.adoc[安装指南]。

[NOTE]
备节点数据库只需要安装,**不需要启动**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ C 层通过复合类型返回读取结果:`sys.dbms_output_line(line TEXT, sta
=== 兼容边界

- 批量读取使用 `TEXT[]` / `VARCHAR2[]`,当前包未声明 Oracle 的 `CHARARR`、`DBMSOUTPUT_LINESARRAY` 集合类型。
- 写入只更新会话缓冲区。IvorySQL 的 `psql` 通过顶层 `CALL` 显示读取过程的输出参数。示例见 xref:v6.0/oracle_compatibility/compat_dbms_output.adoc[DBMS_OUTPUT 包]。
- 写入只更新会话缓冲区。IvorySQL 的 `psql` 通过顶层 `CALL` 显示读取过程的输出参数。示例见 xref:oracle_compatibility/compat_dbms_output.adoc[DBMS_OUTPUT 包]。

== 相关文件与验证

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

== 目的

`ivorysql_ora` 中的 `DBMS_SCHEDULER` 包提供作业管理、日历计算、同步执行和后台调度。配置和调用示例见 xref:v6.0/oracle_compatibility/compat_dbms_scheduler.adoc[DBMS_SCHEDULER 包]。
`ivorysql_ora` 中的 `DBMS_SCHEDULER` 包提供作业管理、日历计算、同步执行和后台调度。配置和调用示例见 xref:oracle_compatibility/compat_dbms_scheduler.adoc[DBMS_SCHEDULER 包]。

== 实现说明

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

通过 `ivorysql_ora` 扩展提供 Oracle 风格的事务控制接口,复用已有 PL/iSQL 语句和事务管理函数。本实现支持 `COMMIT`、`ROLLBACK`、`SAVEPOINT`、`ROLLBACK_SAVEPOINT`、`READ_ONLY` 和 `READ_WRITE`,改动限定在扩展内部,不增加内核事务接口。

使用方式及调用限制见 xref:v6.0/oracle_compatibility/compat_dbms_transaction.adoc[DBMS_TRANSACTION 包]。
使用方式及调用限制见 xref:oracle_compatibility/compat_dbms_transaction.adoc[DBMS_TRANSACTION 包]。

== 实现说明

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

通过 `ivorysql_ora` 中的三个包函数,读取 PL/iSQL 当前异常和调用上下文,并生成 Oracle 风格的诊断文本:`FORMAT_ERROR_BACKTRACE`、`FORMAT_ERROR_STACK` 和 `FORMAT_CALL_STACK`。

实现由包接口、C 格式转换和 PL/iSQL 上下文接口组成。使用示例见 xref:v6.0/oracle_compatibility/compat_dbms_utility.adoc[DBMS_UTILITY 包]。
实现由包接口、C 格式转换和 PL/iSQL 上下文接口组成。使用示例见 xref:oracle_compatibility/compat_dbms_utility.adoc[DBMS_UTILITY 包]。

== 实现说明

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

在 `ivorysql_ora` 中定义 `SYS.V$SESSION`、`SYS.V$PROCESS` 和 `SYS.V$PARAMETER`,将底层活动统计及配置参数映射为 Oracle 风格的视图列。实现复用现有数据源和统计函数,不增加采集进程或新的统计存储。

列定义及查询示例见 xref:v6.0/oracle_compatibility/compat_dynamic_performance_view.adoc[动态性能视图]。
列定义及查询示例见 xref:oracle_compatibility/compat_dynamic_performance_view.adoc[动态性能视图]。

== 实现说明

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

== 目的

在 Oracle 兼容模式下支持包含 `+#+` 的未加引号标识符,并保留以 +#+ 开头的运算符语义。使用示例见 xref:v6.0/oracle_compatibility/compat_identifier_hash_support.adoc[标识符支持 +#+ 字符]。
在 Oracle 兼容模式下支持包含 `+#+` 的未加引号标识符,并保留以 +#+ 开头的运算符语义。使用示例见 xref:oracle_compatibility/compat_identifier_hash_support.adoc[标识符支持 +#+ 字符]。

实现包含两部分:扩展 Oracle 词法分析器的标识符字符集,通过前瞻区分标识符与 JSON 运算符;同步调整标识符引用函数,使合法名称不会仅因包含 +#+ 而被添加双引号。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

== 目的

`ivorysql_ora` 提供 Oracle 兼容的 `LENGTHC`,在 `UTF8` 下统计 Unicode NFC 规范化后的码点数。调用示例见 xref:v6.0/oracle_compatibility/compat_lengthc_function.adoc[字符长度函数]。
`ivorysql_ora` 提供 Oracle 兼容的 `LENGTHC`,在 `UTF8` 下统计 Unicode NFC 规范化后的码点数。调用示例见 xref:oracle_compatibility/compat_lengthc_function.adoc[字符长度函数]。

== 实现说明

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

通过 Oracle 解析器将 `LISTAGG` 的排序拼接语法转换为已有的 `string_agg` 聚合表达式,并在结果外层增加 4000 字节检查。实现复用普通聚合的排序、分组和 NULL 处理,不单独注册新的 LISTAGG 聚合状态或转换函数。

使用方式见 xref:v6.0/oracle_compatibility/compat_listagg_function.adoc[LISTAGG 聚合函数]。
使用方式见 xref:oracle_compatibility/compat_listagg_function.adoc[LISTAGG 聚合函数]。

== 实现说明

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

== 目的

支持 Oracle 风格的 `ALTER TABLE ... MODIFY` 列定义,将类型与可空性修改转换为已有的 ALTER TABLE 内部命令。使用示例见 xref:v6.0/oracle_compatibility/compat_modify_column_compatibility.adoc[MODIFY 列兼容]。
支持 Oracle 风格的 `ALTER TABLE ... MODIFY` 列定义,将类型与可空性修改转换为已有的 ALTER TABLE 内部命令。使用示例见 xref:oracle_compatibility/compat_modify_column_compatibility.adoc[MODIFY 列兼容]。

列定义中的类型与 NOT NULL 是两个独立操作。只把约束放进类型修改命令的 `ColumnDef.constraints` 中,现有类型修改路径不会应用该约束,因此解析阶段必须显式生成独立子命令。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

== 目的

IvorySQL 实现 Oracle `UTL_MATCH` 包的四个函数:`EDIT_DISTANCE`、`EDIT_DISTANCE_SIMILARITY`、`JARO_WINKLER` 和 `JARO_WINKLER_SIMILARITY`,包括 NULL 语义、字节级比较、换位取整及前缀加权条件等行为均与 Oracle 保持一致。用户示例见 xref:v6.0/oracle_compatibility/compat_utl_match.adoc[UTL_MATCH 包]。
IvorySQL 实现 Oracle `UTL_MATCH` 包的四个函数:`EDIT_DISTANCE`、`EDIT_DISTANCE_SIMILARITY`、`JARO_WINKLER` 和 `JARO_WINKLER_SIMILARITY`,包括 NULL 语义、字节级比较、换位取整及前缀加权条件等行为均与 Oracle 保持一致。用户示例见 xref:oracle_compatibility/compat_utl_match.adoc[UTL_MATCH 包]。

== 实现说明

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

== 目的

`ivorysql_ora` 提供 Oracle 兼容的 `UTL_RAW.CAST_TO_RAW`,将文本的数据库编码字节作为 `RAW` 返回。调用示例见 xref:v6.0/oracle_compatibility/compat_utl_raw.adoc[UTL_RAW 包]。
`ivorysql_ora` 提供 Oracle 兼容的 `UTL_RAW.CAST_TO_RAW`,将文本的数据库编码字节作为 `RAW` 返回。调用示例见 xref:oracle_compatibility/compat_utl_raw.adoc[UTL_RAW 包]。

== 实现说明

Expand All @@ -24,7 +24,7 @@ RETURN pg_catalog.convert_to(c::text, pg_catalog.getdatabaseencoding());

=== 显示与空值

`RAW` 沿用 `bytea_output` 的显示格式。默认以 `\x` 开头显示十六进制字节串。需要返回十六进制文本时可调用 xref:v6.0/oracle_builtin_functions/rawtohex.adoc[RAWTOHEX]。
`RAW` 沿用 `bytea_output` 的显示格式。默认以 `\x` 开头显示十六进制字节串。需要返回十六进制文本时可调用 xref:oracle_builtin_functions/rawtohex.adoc[RAWTOHEX]。

`convert_to()` 对 `NULL` 输入返回 `NULL`。空字符串的结果取决于传入包函数的值,分别对应 `NULL` 或零字节的 `RAW`。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,16 @@ IvorySQL 源码托管在 GitHub:<https://github.com/IvorySQL>。

=== 签署 CLA

在提交代码或文档贡献之前,为了确保代码合法合规,个人或企业贡献者需要签署贡献者许可协议(CLA)。签署 CLA 是 IvorySQL 社区接受贡献的必要条件,以确保您的贡献被合法分发。请根据下列链接下载 CLA 进行签署并将签署后的 CLA 发送至 cla@ivorysql.org。
代码和文档贡献者需要签署贡献者许可协议(CLA)。

* https://ivorysql.org/pdf/individual_cla.pdf[个人贡献者]
* https://ivorysql.org/pdf/corporate_cla.pdf[企业贡献者]
以个人身份在 GitHub 贡献时,请先提交拉取请求(PR),再按 PR 中的 CLA 检查提示进入 https://cla.ivorysql.org[IvorySQL CLA 在线签署页面]。使用提交 PR 的 GitHub 账号登录并填写表单,即可在线完成签署。签署后,PR 的 CLA 检查会自动更新,签署的协议 PDF 副本会通过邮件发送。

企业贡献者请下载并签署 https://ivorysql.org/pdf/corporate_cla.pdf[企业贡献者 CLA],将签署后的文件发送至 mailto:cla@ivorysql.org[cla@ivorysql.org]。

[TIP]
如果您通过 AtomGit 平台进行贡献,系统会自动协助您完成 CLA 签署流程,无需手动下载和发送文件。
通过 AtomGit 提交贡献时,请按平台提示完成 CLA 签署。

未签署 CLA 的 Pull Request 将无法进入评审阶段。
需要 CLA 检查的 PR 须通过检查后才能进入评审。


== **通用贡献流程**
Expand Down Expand Up @@ -348,7 +349,7 @@ git checkout -b new-branch-name

==== 编辑文档

在新建的 new-branch-name 中编辑文档。IvorySQL 文档使用 AsciiDoc 格式编写,请参考 xref:v6.0/contribution/asciidoc_syntax_reference.adoc[AsciiDoc 语法参考]。
在新建的 new-branch-name 中编辑文档。IvorySQL 文档使用 AsciiDoc 格式编写,请参考 xref:contribution/asciidoc_syntax_reference.adoc[AsciiDoc 语法参考]。

添加新页面时:
. 将 `.adoc` 文件放入正确目录(CN/ 或 EN/ 对应版本目录)
Expand Down Expand Up @@ -395,7 +396,7 @@ IvorySQL 作为一款基于 PostgreSQL 研发的 Oracle 兼容数据库,天然

===== 确认组件未被适配

在开始适配工作之前,请先查阅 xref:v6.0/ecosystem_components/ecosystem_overview.adoc[生态组件适配列表],确认目标组件是否已完成适配。如果目标组件不在列表中,则继续后面的流程;否则,请重新选择一个未适配的组件。
在开始适配工作之前,请先查阅 xref:ecosystem_components/ecosystem_overview.adoc[生态组件适配列表],确认目标组件是否已完成适配。如果目标组件不在列表中,则继续后面的流程;否则,请重新选择一个未适配的组件。

===== 认领或新建 Issue

Expand Down Expand Up @@ -474,7 +475,7 @@ Oracle 兼容模式测试不通过——尤其是执行 `CREATE EXTENSION` 就

==== 文档编写

IvorySQL 文档使用 AsciiDoc 编写的,其语法与 Markdown 类似但功能更加强大。如果不熟悉 AsciiDoc 语法,可参阅 xref:v6.0/contribution/asciidoc_syntax_reference.adoc[asciidoc语法快速参考]。
IvorySQL 文档使用 AsciiDoc 编写的,其语法与 Markdown 类似但功能更加强大。如果不熟悉 AsciiDoc 语法,可参阅 xref:contribution/asciidoc_syntax_reference.adoc[asciidoc语法快速参考]。

===== 文档结构

Expand Down Expand Up @@ -569,7 +570,7 @@ ivorysql=# SELECT * FROM pg_available_extensions WHERE name = '<扩展名>';

===== 同步更新概述页

完成组件文档编写后,请务必同步更新 xref:v6.0/ecosystem_components/ecosystem_overview.adoc[ecosystem_overview.adoc] 中的插件列表表格,在表格末尾追加一行新记录,包含以下信息:
完成组件文档编写后,请务必同步更新 xref:ecosystem_components/ecosystem_overview.adoc[ecosystem_overview.adoc] 中的插件列表表格,在表格末尾追加一行新记录,包含以下信息:

* 序号:当前最大序号加 1
* 插件名称:带 xref 链接的插件名称
Expand All @@ -593,7 +594,7 @@ git checkout -b feature/adapt-<组件名称>

===== 添加文件

. 将文档文件放入 `CN/modules/ROOT/pages/v6.0/ecosystem_components/` 目录
. 将文档文件放入 `CN/modules/ROOT/pages/ecosystem_components/` 目录
. 如有图片资源,放入 `CN/modules/ROOT/images/` 目录
. 同步准备英文版本,放入对应的 EN 目录
. 更新 CN 和 EN 的 `nav.adoc` 和 `ecosystem_overview.adoc` 里的链接
Expand Down
Loading
Loading