From 5697bb74e66ba7dbae2d596f5dd8968b153ac435 Mon Sep 17 00:00:00 2001 From: himmel Date: Sat, 9 May 2026 02:47:27 +0000 Subject: [PATCH] Rebrand for IvorySQL distribution: ivy_mooncake (minimal footprint) The repo is renamed "ivy_mooncake" (GitHub fork name, README title); the extension, cdylib, Cargo package, and SQL-level identifiers all stay "pg_mooncake" so SQL written against pg_mooncake keeps working. Mirrors the ivy_duckdb pattern (the IvorySQL pg_duckdb fork installs as the pg_duckdb extension). Changes vs upstream Mooncake-Labs/pg_mooncake (b7c67e0): Submodules - all three forked to IvorySQL with ivy_* path names: - pg_duckdb -> ivy_duckdb (IvorySQL/ivy_duckdb) - moonlink -> ivy_moonlink (IvorySQL/ivy_moonlink) - duckdb_mooncake -> ivy_duckdb_mooncake (IvorySQL/ivy_duckdb_mooncake; pinned at the same upstream SHA bd9e5f3a) Path references following the renamed submodules: - Cargo.toml: moonlink_*.path = "ivy_moonlink/..." - Makefile: targets ivy_duckdb, ivy_duckdb_mooncake - .vscode/c_cpp_properties.json: \${workspaceFolder}/ivy_duckdb/** - Dockerfile: COPY ivy_moonlink ivy_moonlink Repo identity: - README rewritten as "IvorySQL distribution of pg_mooncake" framing, clone URL IvorySQL/ivy_mooncake.git; SQL examples and shared_preload_libraries stay pg_mooncake Toolchain: - rust-toolchain 1.88.0 -> 1.91.1 (required by aws-sdk-* MSRV in moonlink_service via the bgworker feature) Intentionally NOT renamed (preserved at upstream values for SQL/ABI compatibility): - Extension name, cdylib library, Cargo package -> pg_mooncake - module_pathname='pg_mooncake', requires='pg_duckdb' in control file - DuckDB-side names: mooncake schema, mooncake access method, pgmooncake_* C symbols, INSTALL mooncake FROM community Verified end-to-end: make ivy_duckdb installs pg_duckdb.so; cargo pgrx regress --resetdb passes 3/3 (setup, partitioned_table, sanity) under rust 1.91.1 with shared_preload_libraries='pg_duckdb,pg_mooncake'. Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitmodules | 18 ++++---- .vscode/c_cpp_properties.json | 2 +- Cargo.toml | 4 +- Dockerfile | 2 +- Makefile | 14 +++---- README.md | 57 ++++++++------------------ ivy_duckdb | 1 + duckdb_mooncake => ivy_duckdb_mooncake | 0 ivy_moonlink | 1 + moonlink | 1 - pg_duckdb | 1 - rust-toolchain.toml | 2 +- 12 files changed, 41 insertions(+), 62 deletions(-) create mode 160000 ivy_duckdb rename duckdb_mooncake => ivy_duckdb_mooncake (100%) create mode 160000 ivy_moonlink delete mode 160000 moonlink delete mode 160000 pg_duckdb diff --git a/.gitmodules b/.gitmodules index 54a4945..0c4a3a6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ -[submodule "duckdb_mooncake"] - path = duckdb_mooncake - url = https://github.com/Mooncake-Labs/duckdb_mooncake.git -[submodule "moonlink"] - path = moonlink - url = https://github.com/Mooncake-Labs/moonlink.git -[submodule "pg_duckdb"] - path = pg_duckdb - url = https://github.com/duckdb/pg_duckdb.git +[submodule "ivy_moonlink"] + path = ivy_moonlink + url = https://github.com/IvorySQL/ivy_moonlink.git +[submodule "ivy_duckdb"] + path = ivy_duckdb + url = https://github.com/IvorySQL/ivy_duckdb.git +[submodule "ivy_duckdb_mooncake"] + path = ivy_duckdb_mooncake + url = https://github.com/IvorySQL/ivy_duckdb_mooncake.git diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 51e1cb9..3e9c228 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -4,7 +4,7 @@ { "name": "Dev Container", "includePath": [ - "${workspaceFolder}/pg_duckdb/**", + "${workspaceFolder}/ivy_duckdb/**", "/home/vscode/.pgrx/18.*/src/**" ] } diff --git a/Cargo.toml b/Cargo.toml index e7f33b7..6896c90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,8 +21,8 @@ pg18 = ["pgrx/pg18"] [dependencies] bincode = "2" -moonlink_rpc.path = "moonlink/src/moonlink_rpc" -moonlink_service = { path = "moonlink/src/moonlink_service", optional = true } +moonlink_rpc.path = "ivy_moonlink/src/moonlink_rpc" +moonlink_service = { path = "ivy_moonlink/src/moonlink_service", optional = true } native-tls = "0.2" pgrx = "0.16.1" postgres.git = "https://github.com/Mooncake-Labs/rust-postgres.git" diff --git a/Dockerfile b/Dockerfile index 62de71b..1e76008 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN cargo install --locked cargo-pgrx@0.16.1 \ WORKDIR pg_mooncake COPY Cargo.toml Makefile pg_mooncake.control . -COPY moonlink moonlink +COPY ivy_moonlink ivy_moonlink COPY src src RUN make package diff --git a/Makefile b/Makefile index 5ffda6e..d317f20 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ PG_VERSION ?= pg18 export PG_CONFIG := $(shell cargo pgrx info pg-config $(PG_VERSION)) MAKEFLAGS += --no-print-directory -.PHONY: help clean duckdb_mooncake format install package pg_duckdb run test +.PHONY: help clean ivy_duckdb_mooncake format install package ivy_duckdb run test help: @echo "Usage: make [OPTIONS]" @@ -10,7 +10,7 @@ help: @echo "Commands:" @echo " run Build and run pg_mooncake for development" @echo " install Build and install pg_mooncake" - @echo " pg_duckdb Build and install pg_duckdb" + @echo " ivy_duckdb Build and install ivy_duckdb" @echo " package Build an installation package for release" @echo " format Format the codebase" @echo " test Run all tests" @@ -22,8 +22,8 @@ help: clean: @cargo clean -duckdb_mooncake: - @$(MAKE) -C duckdb_mooncake GEN=ninja OVERRIDE_GIT_DESCRIBE=v1.4.1 +ivy_duckdb_mooncake: + @$(MAKE) -C ivy_duckdb_mooncake GEN=ninja OVERRIDE_GIT_DESCRIBE=v1.4.1 format: @cargo fmt @@ -35,10 +35,10 @@ install: package: @cargo pgrx package -pg_duckdb: - @$(MAKE) -C pg_duckdb install -j$(shell nproc) +ivy_duckdb: + @$(MAKE) -C ivy_duckdb install -j$(shell nproc) -run: pg_duckdb +run: ivy_duckdb @cargo pgrx run test: diff --git a/README.md b/README.md index 62c33e5..589087a 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,44 @@
-

pg_mooncake 🥮

-

Real-time analytics on Postgres tables

+

ivy_mooncake 🥮

+

Real-time analytics on Postgres tables (IvorySQL distribution)

[![][docs-shield]][docs-link] [![][license-shield]][license-link] -[![][slack-shield]][slack-link] -[![][x-shield]][x-link]
## Overview -**pg_mooncake** is a Postgres extension that creates a columnstore mirror of your Postgres tables in [Iceberg][iceberg-link], enabling fast analytics queries with sub-second freshness: +**ivy_mooncake** is the IvorySQL distribution of [pg_mooncake][upstream-link], a Postgres extension that creates a columnstore mirror of your Postgres tables in [Iceberg][iceberg-link], enabling fast analytics queries with sub-second freshness: - **Real-time ingestion** powered by [moonlink][moonlink-link] for streaming and batched INSERT/UPDATE/DELETE. - **Fast analytics** accelerated by [DuckDB][pgduckdb-link], ranking top 10 on [ClickBench][clickbench-link]. - **Postgres-native** allowing you to query a columnstore table just like a regular Postgres table. - **Iceberg-native** making your data readily accessible by other query engines. -## Installation - -### Option 1: Docker - -For new users, we recommend using the Docker image to get started quickly: -```bash -docker run --name mooncake --rm -e POSTGRES_PASSWORD=password mooncakelabs/pg_mooncake -``` +This fork tracks IvorySQL-maintained branches of `pg_duckdb`, `moonlink`, and `duckdb_mooncake` (`ivy_duckdb`, `ivy_moonlink`, `ivy_duckdb_mooncake`). The repository name is `ivy_mooncake`, but the extension it installs is unchanged — `pg_mooncake` — so SQL-side compatibility with upstream is preserved. -This will start Postgres with pg_mooncake preinstalled. You can then connect to it using `psql` with the default user `postgres`: -```bash -docker exec -it mooncake psql -U postgres -``` - -### Option 2: From Source +## Installation -To build pg_mooncake, first install [Rust][rust-install], [pgrx][pgrx-install], and [the build tools for DuckDB][duckdb-install]. +To build ivy_mooncake, first install [Rust][rust-install], [pgrx][pgrx-install], and [the build tools for DuckDB][duckdb-install]. -Then, clone the repository: +Then, clone the repository with submodules: ```bash -git clone --recurse-submodules https://github.com/Mooncake-Labs/pg_mooncake.git +git clone --recurse-submodules https://github.com/IvorySQL/ivy_mooncake.git ``` To build and install for Postgres versions 14-18, run: ```bash cargo pgrx init --pg18=$(which pg_config) # Replace with your Postgres version -make pg_duckdb # Skip if pg_duckdb is already installed +make ivy_duckdb # Skip if ivy_duckdb is already installed make install PG_VERSION=pg18 ``` -Finally, add pg_mooncake to `shared_preload_libraries` in your `postgresql.conf` file and enable logical replication: +Finally, add `pg_mooncake` to `shared_preload_libraries` in your `postgresql.conf` file and enable logical replication: ```ini duckdb.allow_community_extensions = true shared_preload_libraries = 'pg_duckdb,pg_mooncake' wal_level = logical ``` -For a complete walkthrough, refer to our [Dockerfile][dockerfile-link]. - ## Quick Start First, create the pg_mooncake extension: @@ -91,26 +75,21 @@ Finally, query `trades_iceberg` to see that it reflects the up-to-date state of SELECT avg(price) FROM trades_iceberg WHERE symbol = 'AMZN'; ``` -## Contributing +Note: The repository is renamed to `ivy_mooncake` only at the GitHub-fork level. Inside the repo, the extension, the cdylib, and all SQL-level identifiers (`pg_mooncake` extension, `mooncake.*` schema, `USING mooncake` access method, `INSTALL mooncake FROM community`) are intentionally unchanged from upstream so SQL written against `pg_mooncake` continues to work. + +## Upstream -pg_mooncake is an open-source project maintained by [Mooncake Labs][mooncake-link] and licensed under the [MIT License][license-link]. We'd love your help to make it even better! Join [our Slack][slack-link], participate in [discussions][discussions-link], open [issues][issues-link] to report bugs or suggest features, contribute code and documentation, or help us improve the project in any way. All contributions are welcome! 🥮 +ivy_mooncake is a fork of [Mooncake-Labs/pg_mooncake][upstream-link] under the [MIT License][license-link]. [clickbench-link]: https://www.mooncake.dev/blog/clickbench-v0.1 -[discussions-link]: https://github.com/Mooncake-Labs/pg_mooncake/discussions -[dockerfile-link]: https://github.com/Mooncake-Labs/pg_mooncake/blob/main/Dockerfile [docs-link]: https://docs.mooncake.dev/ [docs-shield]: https://img.shields.io/badge/docs-mooncake?logo=readthedocs&logoColor=white [duckdb-install]: https://duckdb.org/docs/stable/dev/building/overview.html#prerequisites [iceberg-link]: https://iceberg.apache.org/ -[issues-link]: https://github.com/Mooncake-Labs/pg_mooncake/issues -[license-link]: https://github.com/Mooncake-Labs/pg_mooncake/blob/main/LICENSE +[license-link]: ./LICENSE [license-shield]: https://img.shields.io/badge/License-MIT-blue -[mooncake-link]: https://mooncake.dev/ -[moonlink-link]: https://github.com/Mooncake-Labs/moonlink -[pgduckdb-link]: https://github.com/duckdb/pg_duckdb +[moonlink-link]: https://github.com/IvorySQL/ivy_moonlink +[pgduckdb-link]: https://github.com/IvorySQL/ivy_duckdb [pgrx-install]: https://github.com/pgcentralfoundation/pgrx?tab=readme-ov-file#getting-started [rust-install]: https://www.rust-lang.org/tools/install -[slack-link]: https://join.slack.com/t/mooncake-devs/shared_invite/zt-2sepjh5hv-rb9jUtfYZ9bvbxTCUrsEEA -[slack-shield]: https://img.shields.io/badge/Mooncake%20Devs-purple?logo=slack -[x-link]: https://x.com/mooncakelabs -[x-shield]: https://img.shields.io/twitter/url?label=%40mooncakelabs&url=https%3A%2F%2Fx.com%2Fmooncakelabs +[upstream-link]: https://github.com/Mooncake-Labs/pg_mooncake diff --git a/ivy_duckdb b/ivy_duckdb new file mode 160000 index 0000000..5eb63f8 --- /dev/null +++ b/ivy_duckdb @@ -0,0 +1 @@ +Subproject commit 5eb63f85fca8b8312c2b079557a8e0b2a9ab6a6b diff --git a/duckdb_mooncake b/ivy_duckdb_mooncake similarity index 100% rename from duckdb_mooncake rename to ivy_duckdb_mooncake diff --git a/ivy_moonlink b/ivy_moonlink new file mode 160000 index 0000000..bc37b34 --- /dev/null +++ b/ivy_moonlink @@ -0,0 +1 @@ +Subproject commit bc37b34578a50635fee4d3db3e0c7331cc17d02b diff --git a/moonlink b/moonlink deleted file mode 160000 index c1a99ef..0000000 --- a/moonlink +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c1a99ef01af878a5ffa77d1019ef4833a7907410 diff --git a/pg_duckdb b/pg_duckdb deleted file mode 160000 index 7daa8e5..0000000 --- a/pg_duckdb +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7daa8e53a2d977e6312d937323ed2e7d907d0707 diff --git a/rust-toolchain.toml b/rust-toolchain.toml index c6f8dfa..47a730b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.88.0" +channel = "1.91.1" components = ["clippy", "rustfmt"]