From 42d89296f69832c99ebb49c97cfe147e0982c810 Mon Sep 17 00:00:00 2001 From: Makisuo Date: Sat, 3 Oct 2026 15:49:35 +0200 Subject: [PATCH] Rename to @maple-dev/effect-orm The builder now compiles to ClickHouse and Postgres, so the name follows. Imports, error tag prefixes, repository URLs and the live-test variables (EFFECT_ORM_CLICKHOUSE_URL/_USER/_PASSWORD) change with it. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 6 ++--- CHANGELOG.md | 3 +++ README.md | 30 ++++++++++++---------- bun.lock | 2 +- design/dialects.md | 2 +- docs/README.md | 20 +++++++-------- docs/benchmarking.md | 12 ++++----- docs/decoding-results.md | 2 +- docs/expressions.md | 4 +-- docs/extending.md | 12 ++++----- docs/getting-started.md | 14 +++++----- docs/joins-and-subqueries.md | 2 +- docs/params-and-compilation.md | 8 +++--- docs/postgres.md | 4 +-- docs/recipes.md | 14 +++++----- docs/reference.md | 12 ++++----- docs/running-queries.md | 6 ++--- docs/tables-and-types.md | 8 +++--- docs/testing.md | 6 ++--- docs/troubleshooting.md | 6 ++--- package.json | 10 +++++--- scripts/check-doc-examples.mjs | 4 +-- scripts/check-package.ts | 4 +-- scripts/release-support.ts | 4 +-- scripts/test-clickhouse.ts | 4 +-- src/benchmark/model.ts | 2 +- src/ch/compile.test.ts | 4 +-- src/ch/compile.ts | 4 +-- src/ch/errors.ts | 4 +-- src/ch/subquery.test.ts | 2 +- src/docs-examples.test.ts | 2 +- src/index.ts | 2 +- src/postgres.ts | 2 +- src/sql/statement.ts | 2 +- tests/benchmark-regressions.test.ts | 6 ++--- tests/clickhouse-support.ts | 10 ++++---- tests/deep-builder.clickhouse.test.ts | 4 +-- tests/deep-codecs.clickhouse.test.ts | 4 +-- tests/dialect-cases.ts | 6 ++--- tests/dialect-coverage.test.ts | 4 +-- tests/package-consumer.mts | 14 +++++----- tests/publish-readiness.clickhouse.test.ts | 4 +-- 42 files changed, 141 insertions(+), 134 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cd84a9..07e1ad0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: - run: bun install --frozen-lockfile - name: Check package, types, unit tests and live dialect env: - EFFECT_CLICKHOUSE_TEST_URL: http://127.0.0.1:8123 - EFFECT_CLICKHOUSE_TEST_USER: maple - EFFECT_CLICKHOUSE_TEST_PASSWORD: maple + EFFECT_ORM_CLICKHOUSE_URL: http://127.0.0.1:8123 + EFFECT_ORM_CLICKHOUSE_USER: maple + EFFECT_ORM_CLICKHOUSE_PASSWORD: maple run: bun run test:release diff --git a/CHANGELOG.md b/CHANGELOG.md index a54a655..db3aa37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +- Rename the package to `@maple-dev/effect-orm` and the repository to `MapleTechLabs/effect-orm`. + Imports, error `_tag` prefixes (`@maple-dev/effect-orm/QueryBuilderError`, ...) and the live-test + variables (`EFFECT_ORM_CLICKHOUSE_URL`, `_USER`, `_PASSWORD`) change with it. - Add `Dialect`: how a compiled query writes identifiers and literals, binds params, and which clauses exist. `compile` and friends take `options.dialect`; `clickhouseDialect` is the default and its output is unchanged. diff --git a/README.md b/README.md index 48d7234..419acec 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ -# @maple-dev/effect-clickhouse +# @maple-dev/effect-orm -Type-safe ClickHouse queries, result decoding, and reproducible benchmarks for Effect and TypeScript. +Type-safe ClickHouse and Postgres queries, result decoding, and reproducible benchmarks for Effect and TypeScript. + +Formerly `@maple-dev/effect-clickhouse`. [Read the documentation](https://effect-clickhouse.maple.dev) · [Getting started](./docs/getting-started.md) · [Recipes](./docs/recipes.md) @@ -27,7 +29,7 @@ Built on [Effect](https://effect.website) (peer dependency). Install the package with its Effect 4 peer: ```bash -bun add @maple-dev/effect-clickhouse "effect@^4.0.0" +bun add @maple-dev/effect-orm "effect@^4.0.0" ``` See [Getting started](./docs/getting-started.md) for source builds and examples. @@ -39,8 +41,8 @@ prereleases are incompatible. ## Quick start ```ts -import * as CH from "@maple-dev/effect-clickhouse" -import * as T from "@maple-dev/effect-clickhouse/types" +import * as CH from "@maple-dev/effect-orm" +import * as T from "@maple-dev/effect-orm/types" // 1. Describe a table const Events = CH.table( @@ -163,17 +165,17 @@ regressions live in [`src/docs-examples.test.ts`](./src/docs-examples.test.ts). | Import | Contents | | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `@maple-dev/effect-clickhouse` | Curated public API: `from`, `compile`, `param`, expression helpers, and ClickHouse functions under friendly names (`min`, `max`, `count`, `quantile`, …). | -| `@maple-dev/effect-clickhouse/types` | Column-type constructors (`string`, `uint64`, `dateTime`, `map`, `array`, `nullable`, …) and the `CH*` type descriptors. | -| `@maple-dev/effect-clickhouse/expr` | Kitchen-sink namespace: every expression helper plus all ClickHouse functions under their raw names (`min_`, `toString_`, `toStartOfInterval`, `dynamicColumn`, …). Handy for `import * as CH`. | -| `@maple-dev/effect-clickhouse/sql` | The low-level `SqlFragment` AST (`raw`, `ident`, `compile`, …) for hand-rolling fragments. | -| `@maple-dev/effect-clickhouse/postgres` | The Postgres dialect: `postgresDialect`, Postgres column types and functions, and a `compile` that defaults to Postgres. | +| `@maple-dev/effect-orm` | Curated public API: `from`, `compile`, `param`, expression helpers, and ClickHouse functions under friendly names (`min`, `max`, `count`, `quantile`, …). | +| `@maple-dev/effect-orm/types` | Column-type constructors (`string`, `uint64`, `dateTime`, `map`, `array`, `nullable`, …) and the `CH*` type descriptors. | +| `@maple-dev/effect-orm/expr` | Kitchen-sink namespace: every expression helper plus all ClickHouse functions under their raw names (`min_`, `toString_`, `toStartOfInterval`, `dynamicColumn`, …). Handy for `import * as CH`. | +| `@maple-dev/effect-orm/sql` | The low-level `SqlFragment` AST (`raw`, `ident`, `compile`, …) for hand-rolling fragments. | +| `@maple-dev/effect-orm/postgres` | The Postgres dialect: `postgresDialect`, Postgres column types and functions, and a `compile` that defaults to Postgres. | ## Extending with custom functions ```ts import type { DateTime } from "effect" -import { defineFn, sameAs } from "@maple-dev/effect-clickhouse" +import { defineFn, sameAs } from "@maple-dev/effect-orm" // Declare any ClickHouse function not already wrapped. The second argument is // the ClickHouse type it returns — required, because that is what lets a query @@ -195,8 +197,8 @@ run the client example too, with `CLICKHOUSE_URL`, `CLICKHOUSE_USERNAME`, and Run `bun run build`, `bun run typecheck`, and `bun run test` from this package. Tests include regressions for nullable results, UNION column alignment, tenant scoping, custom parameters, and DateTime64 precision. -To include the live ClickHouse cases, set `EFFECT_CLICKHOUSE_TEST_URL` and, if needed, -`EFFECT_CLICKHOUSE_TEST_USER` and `EFFECT_CLICKHOUSE_TEST_PASSWORD`. They use only SELECTs and CTEs. +To include the live ClickHouse cases, set `EFFECT_ORM_CLICKHOUSE_URL` and, if needed, +`EFFECT_ORM_CLICKHOUSE_USER` and `EFFECT_ORM_CLICKHOUSE_PASSWORD`. They use only SELECTs and CTEs. Use `bun run test:release` before publishing: it requires a live endpoint and checks the build, types, tests, docs, and an isolated tarball consumer. `prepublishOnly` enforces @@ -209,7 +211,7 @@ MIT ## Query benchmarks -The optional `@maple-dev/effect-clickhouse/benchmark` entry point and bundled +The optional `@maple-dev/effect-orm/benchmark` entry point and bundled `ch-bench` CLI measure real queries, compare fixed workloads, and save evidence. See [Benchmarking](docs/benchmarking.md) and the [agent playbook](docs/benchmark-agent.md). The root SQL builder remains driver-free. diff --git a/bun.lock b/bun.lock index 8cc4b6c..ea83fbd 100644 --- a/bun.lock +++ b/bun.lock @@ -3,7 +3,7 @@ "configVersion": 1, "workspaces": { "": { - "name": "@maple-dev/effect-clickhouse", + "name": "@maple-dev/effect-orm", "devDependencies": { "@clickhouse/client": "1.21.0", "@effect/language-service": "^0.87.3", diff --git a/design/dialects.md b/design/dialects.md index 055f2ee..b02cba5 100644 --- a/design/dialects.md +++ b/design/dialects.md @@ -68,7 +68,7 @@ What we deliberately do not copy: three places in `compile.ts`, which kept ClickHouse output byte-identical without relocating ~1100 lines. A dialect that needs a structurally different statement is the point to revisit this. -6. **Postgres dialect (done).** `@maple-dev/effect-clickhouse/postgres`: `postgresDialect` +6. **Postgres dialect (done).** `@maple-dev/effect-orm/postgres`: `postgresDialect` (double-quoted identifiers, standard strings with `E'…'` only to escape the param marker, `$n` binding), column types, a function catalog (`count(*)`, `FILTER (WHERE …)`, `percentile_cont`, `date_trunc(…, 'UTC')`, `date_bin`, `array_agg`, `->>`), and a diff --git a/docs/README.md b/docs/README.md index 1589c5e..0585161 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ -# Effect ClickHouse +# Effect ORM -`@maple-dev/effect-clickhouse` builds ClickHouse SQL from typed TypeScript. You describe a +`@maple-dev/effect-orm` builds ClickHouse SQL from typed TypeScript. You describe a table once, and the builder infers column types, output row shapes, and join accessors from it. Queries are immutable values — every method returns a new query — and nothing touches the network: the end product is a `CompiledQuery` holding a SQL string plus a typed decoder. You @@ -65,20 +65,20 @@ Roughly in reading order. | Import | Contents | | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `@maple-dev/effect-clickhouse` | Curated public API — `from`, `compile`, `param`, expression helpers, and ClickHouse functions under friendly names (`min`, `max`, `count`, `quantile`, …) | -| `@maple-dev/effect-clickhouse/types` | Column-type constructors (`string`, `uint64`, `dateTime`, `map`, `array`, `nullable`, …) and the `CH*` type descriptors | -| `@maple-dev/effect-clickhouse/expr` | Kitchen-sink namespace: every expression helper plus all ClickHouse functions under their raw names (`min_`, `toString_`, `dynamicColumn`, `not`, …) | -| `@maple-dev/effect-clickhouse/sql` | The low-level `SqlFragment` AST (`raw`, `ident`, `compile`, …) for hand-rolling fragments | -| `@maple-dev/effect-clickhouse/benchmark` | Driver-free suite definitions, runner, report schemas, and comparisons | -| `@maple-dev/effect-clickhouse/benchmark/http` | ClickHouse HTTP transport, environment configuration, and query-log collection | -| `@maple-dev/effect-clickhouse/benchmark/cli` | `runCli(args)` for embedding the bundled `ch-bench` commands | +| `@maple-dev/effect-orm` | Curated public API — `from`, `compile`, `param`, expression helpers, and ClickHouse functions under friendly names (`min`, `max`, `count`, `quantile`, …) | +| `@maple-dev/effect-orm/types` | Column-type constructors (`string`, `uint64`, `dateTime`, `map`, `array`, `nullable`, …) and the `CH*` type descriptors | +| `@maple-dev/effect-orm/expr` | Kitchen-sink namespace: every expression helper plus all ClickHouse functions under their raw names (`min_`, `toString_`, `dynamicColumn`, `not`, …) | +| `@maple-dev/effect-orm/sql` | The low-level `SqlFragment` AST (`raw`, `ident`, `compile`, …) for hand-rolling fragments | +| `@maple-dev/effect-orm/benchmark` | Driver-free suite definitions, runner, report schemas, and comparisons | +| `@maple-dev/effect-orm/benchmark/http` | ClickHouse HTTP transport, environment configuration, and query-log collection | +| `@maple-dev/effect-orm/benchmark/cli` | `runCli(args)` for embedding the bundled `ch-bench` commands | The root barrel is curated, not exhaustive — see [the reference](./reference.md#whats-only-on-a-subpath) for what lives only on a subpath. ## Query benchmarks -The optional `@maple-dev/effect-clickhouse/benchmark` entry point and bundled +The optional `@maple-dev/effect-orm/benchmark` entry point and bundled `ch-bench` CLI measure real queries, compare fixed workloads, and save evidence. See [Benchmarking](./benchmarking.md) and the [agent playbook](./benchmark-agent.md). The root SQL builder remains driver-free. diff --git a/docs/benchmarking.md b/docs/benchmarking.md index d7251ab..ccb65cf 100644 --- a/docs/benchmarking.md +++ b/docs/benchmarking.md @@ -1,6 +1,6 @@ # Benchmarking ClickHouse queries -The package ships a driver-free `@maple-dev/effect-clickhouse/benchmark` API, +The package ships a driver-free `@maple-dev/effect-orm/benchmark` API, an HTTP adapter at `/benchmark/http`, and the `ch-bench` executable. The builder's root import still does no networking. No Maple account or schema is required. @@ -36,9 +36,9 @@ it does not create a dataset or determine whether your query inputs are represen ## Define a workload ```ts title="benchmark-suite.ts" -import { compile, from, param, table } from "@maple-dev/effect-clickhouse" -import { uint32, string } from "@maple-dev/effect-clickhouse/types" -import * as Bench from "@maple-dev/effect-clickhouse/benchmark" +import { compile, from, param, table } from "@maple-dev/effect-orm" +import { uint32, string } from "@maple-dev/effect-orm/types" +import * as Bench from "@maple-dev/effect-orm/benchmark" const events = table("events", { id: uint32, name: string }) const byName = from(events) @@ -178,12 +178,12 @@ Save this beside `benchmark-suite.ts` as `benchmark-runner.ts`, set the same ```ts title="benchmark-runner.ts" import { Effect } from "effect" -import * as Bench from "@maple-dev/effect-clickhouse/benchmark" +import * as Bench from "@maple-dev/effect-orm/benchmark" import { httpConfigFromEnv, makeHttpClient, makeHttpTransport, -} from "@maple-dev/effect-clickhouse/benchmark/http" +} from "@maple-dev/effect-orm/benchmark/http" import suiteDefinition from "./benchmark-suite" const measurements = await Effect.runPromise( diff --git a/docs/decoding-results.md b/docs/decoding-results.md index 8c384f1..5ec69f6 100644 --- a/docs/decoding-results.md +++ b/docs/decoding-results.md @@ -152,7 +152,7 @@ Both decoders fail with `CompiledQueryDecodeError`, carrying the index of the of ```ts const error = await Effect.runPromise(Effect.flip(compiled.decodeRows([{ name: 42, count: 1 }]))) -error._tag // "@maple-dev/effect-clickhouse/CompiledQueryDecodeError" +error._tag // "@maple-dev/effect-orm/CompiledQueryDecodeError" error.rowIndex // 0 error.message // "Compiled query row 0 did not match its declared output schema" error.cause // the underlying Schema parse error diff --git a/docs/expressions.md b/docs/expressions.md index de96bb9..afdf6ea 100644 --- a/docs/expressions.md +++ b/docs/expressions.md @@ -23,8 +23,8 @@ $.Timestamp.gte(new Date(...)) // Timestamp >= '2026-01-01 00:00:00' `isNull` (or `isNotNull` for present values), declared with `defineCondFn`: ```ts title="null-filter.ts" -import * as CH from "@maple-dev/effect-clickhouse" -import * as T from "@maple-dev/effect-clickhouse/types" +import * as CH from "@maple-dev/effect-orm" +import * as T from "@maple-dev/effect-orm/types" const Notes = CH.table("notes", { Note: T.nullable(T.string) }) const isNull = CH.defineCondFn<[CH.Expr]>("isNull") diff --git a/docs/extending.md b/docs/extending.md index 7515d7c..c85b667 100644 --- a/docs/extending.md +++ b/docs/extending.md @@ -74,8 +74,8 @@ _(Backed by `docs/extending.md > defineCondFn declares a predicate`.)_ When the signature is too irregular for `defineFn`, write the wrapper yourself: ```ts title="typed-function.ts" -import * as CH from "@maple-dev/effect-clickhouse" -import * as T from "@maple-dev/effect-clickhouse/types" +import * as CH from "@maple-dev/effect-orm" +import * as T from "@maple-dev/effect-orm/types" const greatestOf = (first: CH.Expr, ...rest: CH.Expr[]) => CH.compileTypedFnCall("greatest", T.float64.schema, first, ...rest) @@ -101,8 +101,8 @@ For functions whose call syntax is not `fn(a, b)` at all — parametric aggregat anything bespoke: ```ts -import { makeExpr } from "@maple-dev/effect-clickhouse" -import { raw, compile } from "@maple-dev/effect-clickhouse/sql" +import { makeExpr } from "@maple-dev/effect-orm" +import { raw, compile } from "@maple-dev/effect-orm/sql" const quantileExact = (q: number) => (expr: CH.Expr) => makeExpr(raw(`quantileExact(${q})(${compile(expr.toFragment())})`), T.float64.schema) @@ -119,7 +119,7 @@ user-supplied string values through `compile(str(value))` from the `/sql` subpat produces `[object Object]`. For example: ```ts title="escaped-sql.ts" -import { compile, str } from "@maple-dev/effect-clickhouse/sql" +import { compile, str } from "@maple-dev/effect-orm/sql" export const predicate = `Name = ${compile(str("O'Reilly"))}` console.log(predicate) // Name = 'O\'Reilly' @@ -231,7 +231,7 @@ _(Backed by `docs/extending.md > rawCompiledQuery wraps handwritten SQL`.)_ The `/sql` subpath exposes the layer everything above is built on: ```ts -import { raw, str, ident, int, join, as_, when, compile } from "@maple-dev/effect-clickhouse/sql" +import { raw, str, ident, int, join, as_, when, compile } from "@maple-dev/effect-orm/sql" ``` - `str(value)` — an escaped string literal. **Use this for anything user-supplied.** diff --git a/docs/getting-started.md b/docs/getting-started.md index 6ebc2bd..f086815 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -13,7 +13,7 @@ The package declares `effect ^4.0.0` as a peer dependency; Effect 3 is incompati Install from npm with its Effect 4 peer dependency: ```sh -npm install @maple-dev/effect-clickhouse "effect@^4.0.0" +npm install @maple-dev/effect-orm "effect@^4.0.0" ``` The recommended range accepts stable Effect 4 releases. It excludes Effect 3, the @@ -23,8 +23,8 @@ version used to check these examples; it is not an installation pin. To build from source instead: ```sh -git clone https://github.com/MapleTechLabs/effect-clickhouse.git -cd effect-clickhouse +git clone https://github.com/MapleTechLabs/effect-orm.git +cd effect-orm bun install --frozen-lockfile bun run build bun pm pack @@ -48,8 +48,8 @@ wire response; it does not need a server, credentials, or an existing table. ```ts title="quick-start.ts" import { Effect } from "effect" -import * as CH from "@maple-dev/effect-clickhouse" -import * as T from "@maple-dev/effect-clickhouse/types" +import * as CH from "@maple-dev/effect-orm" +import * as T from "@maple-dev/effect-orm/types" const Events = CH.table("events", { Name: T.string, @@ -106,8 +106,8 @@ when trying their query snippets. Their table and column names are case-sensitiv with your own database. Replace them with your real schema before executing. ```ts title="schema.ts" -import * as CH from "@maple-dev/effect-clickhouse" -import * as T from "@maple-dev/effect-clickhouse/types" +import * as CH from "@maple-dev/effect-orm" +import * as T from "@maple-dev/effect-orm/types" export const Events = CH.table( "events", diff --git a/docs/joins-and-subqueries.md b/docs/joins-and-subqueries.md index b43c622..c98a524 100644 --- a/docs/joins-and-subqueries.md +++ b/docs/joins-and-subqueries.md @@ -145,7 +145,7 @@ That is what `subqueryExpr` is for. It takes the inner query, the column type it as, and a `wrap` function that receives the inner SQL and returns the expression text: ```ts -import { subqueryCond, subqueryExpr } from "@maple-dev/effect-clickhouse" +import { subqueryCond, subqueryExpr } from "@maple-dev/effect-orm" // Stage 1: a cheap scan reading only the sort column. const cheapScan = CH.from(Events) diff --git a/docs/params-and-compilation.md b/docs/params-and-compilation.md index cdfb8b2..fc8fe12 100644 --- a/docs/params-and-compilation.md +++ b/docs/params-and-compilation.md @@ -247,7 +247,7 @@ Two classes, and the line between them is what a runtime value can reach. `QueryBuilderError` describes a **value** the builder was handed and cannot turn into SQL. Code that assembles a query from a request body can hit every one of these with correct code and bad input, so `compile` puts them in the Effect error channel, catchable by the tag -`"@maple-dev/effect-clickhouse/QueryBuilderError"`: +`"@maple-dev/effect-orm/QueryBuilderError"`: | Code | Cause | | ------------------ | ------------------------------------------------------------------------ | @@ -270,8 +270,8 @@ a required parameter and recovers only that typed builder failure; defects are n ```ts title="compile-errors.ts" import { Effect } from "effect" -import * as CH from "@maple-dev/effect-clickhouse" -import * as T from "@maple-dev/effect-clickhouse/types" +import * as CH from "@maple-dev/effect-orm" +import * as T from "@maple-dev/effect-orm/types" const Events = CH.table("events", { Name: T.string }) const query = CH.from(Events) @@ -281,7 +281,7 @@ const query = CH.from(Events) export const outcome = await Effect.runPromise( CH.compile(query, {}).pipe( Effect.map((compiled) => ({ ok: true as const, sql: compiled.sql })), - Effect.catchTag("@maple-dev/effect-clickhouse/QueryBuilderError", (error) => + Effect.catchTag("@maple-dev/effect-orm/QueryBuilderError", (error) => Effect.succeed({ ok: false as const, code: error.code, message: error.message }), ), ), diff --git a/docs/postgres.md b/docs/postgres.md index bf208b5..324584d 100644 --- a/docs/postgres.md +++ b/docs/postgres.md @@ -8,8 +8,8 @@ types whose codecs read what Postgres drivers send, functions spelled the Postgr ```ts title="postgres-quickstart.ts" import { PGlite } from "@electric-sql/pglite" import { Effect } from "effect" -import * as CH from "@maple-dev/effect-clickhouse" -import * as PG from "@maple-dev/effect-clickhouse/postgres" +import * as CH from "@maple-dev/effect-orm" +import * as PG from "@maple-dev/effect-orm/postgres" const Requests = CH.table( "requests", diff --git a/docs/recipes.md b/docs/recipes.md index 2ba3455..db7b9db 100644 --- a/docs/recipes.md +++ b/docs/recipes.md @@ -13,7 +13,7 @@ These examples assume UTC timestamps. ```ts title="time-buckets.ts" import { Effect } from "effect" -import * as CH from "@maple-dev/effect-clickhouse" +import * as CH from "@maple-dev/effect-orm" import { Events } from "./schema" const query = CH.from(Events) @@ -57,7 +57,7 @@ in your product, return an empty result before executing instead. ```ts title="optional-filters.ts" import { Effect } from "effect" -import * as CH from "@maple-dev/effect-clickhouse" +import * as CH from "@maple-dev/effect-orm" import { Events } from "./schema" export const buildQuery = (names: readonly string[], minDurationMs?: number) => @@ -93,8 +93,8 @@ Use `where` to choose events, then `having` to choose groups by their aggregated ```ts title="aggregate-filter.ts" import { Effect } from "effect" -import * as CH from "@maple-dev/effect-clickhouse" -import * as T from "@maple-dev/effect-clickhouse/types" +import * as CH from "@maple-dev/effect-orm" +import * as T from "@maple-dev/effect-orm/types" import { Events } from "./schema" const query = CH.from(Events) @@ -124,7 +124,7 @@ makes `name` unique in this result, so it breaks ties between equal counts. ```ts title="pagination.ts" import { Effect } from "effect" -import * as CH from "@maple-dev/effect-clickhouse" +import * as CH from "@maple-dev/effect-orm" import { Events } from "./schema" const pageSize = 25 @@ -153,8 +153,8 @@ JSON parsing could lose precision. This also works for IDs produced by numeric h ```ts title="large-ids.ts" import { Effect } from "effect" -import * as CH from "@maple-dev/effect-clickhouse" -import * as T from "@maple-dev/effect-clickhouse/types" +import * as CH from "@maple-dev/effect-orm" +import * as T from "@maple-dev/effect-orm/types" const Records = CH.table("records", { Id: T.uint64, Name: T.string }) const query = CH.from(Records) diff --git a/docs/reference.md b/docs/reference.md index 5243090..840af5e 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -1,7 +1,7 @@ # API reference Everything on this page is exported from the root entry point -(`@maple-dev/effect-clickhouse`) unless marked otherwise. +(`@maple-dev/effect-orm`) unless marked otherwise. ## Naming conventions @@ -18,7 +18,7 @@ One exception, because it cannot be anything else: | `in_` / `notIn` | — | `Expr` methods; `in` is reserved | Importing the kitchen-sink namespace -(`import * as CH from "@maple-dev/effect-clickhouse/expr"`) gives you the raw underscored names +(`import * as CH from "@maple-dev/effect-orm/expr"`) gives you the raw underscored names uniformly, which some codebases prefer for exactly this reason. ## What's only on a subpath @@ -287,7 +287,7 @@ their full namespaced tag; `QueryBuilderDefect` remains a defect rather than a t ### `QueryBuilderError` -Tag `"@maple-dev/effect-clickhouse/QueryBuilderError"`. Raised while compiling, and surfaced in +Tag `"@maple-dev/effect-orm/QueryBuilderError"`. Raised while compiling, and surfaced in `compile`'s error channel (thrown by `compileUnsafe`). | `code` | Cause | @@ -298,7 +298,7 @@ Tag `"@maple-dev/effect-clickhouse/QueryBuilderError"`. Raised while compiling, ### `QueryBuilderDefect` -Tag `"@maple-dev/effect-clickhouse/QueryBuilderDefect"`. A DSL misuse no runtime value can cause +Tag `"@maple-dev/effect-orm/QueryBuilderDefect"`. A DSL misuse no runtime value can cause — a query with no `select()`, an `orderBy` entry that is not a tuple, a bad param name, a comparison called on a param marker. Always a defect: `compile` maps only `QueryBuilderError` into the error channel. See @@ -306,11 +306,11 @@ a defect: `compile` maps only `QueryBuilderError` into the error channel. See ### `CompiledQueryEncodeError` -Tag `"@maple-dev/effect-clickhouse/CompiledQueryEncodeError"`. Fails the `encodeRows` Effect +Tag `"@maple-dev/effect-orm/CompiledQueryEncodeError"`. Fails the `encodeRows` Effect when a decoded row cannot be written back to its wire shape. Fields: `message`, `rowIndex`, `cause`. ### `CompiledQueryDecodeError` -Tag `"@maple-dev/effect-clickhouse/CompiledQueryDecodeError"`. Fails the `decodeRows` / +Tag `"@maple-dev/effect-orm/CompiledQueryDecodeError"`. Fails the `decodeRows` / `decodeFirstRow` Effect. Fields: `message`, `rowIndex`, `cause`. diff --git a/docs/running-queries.md b/docs/running-queries.md index e8319f8..0747123 100644 --- a/docs/running-queries.md +++ b/docs/running-queries.md @@ -21,8 +21,8 @@ schema and writes no data. Set `CLICKHOUSE_URL`, `CLICKHOUSE_USERNAME`, and ```ts title="run-query.ts" import { ClickhouseClient } from "@effect/sql-clickhouse" import { Config, Effect, Redacted } from "effect" -import * as CH from "@maple-dev/effect-clickhouse" -import * as T from "@maple-dev/effect-clickhouse/types" +import * as CH from "@maple-dev/effect-orm" +import * as T from "@maple-dev/effect-orm/types" const ClickHouseLive = ClickhouseClient.layerConfig({ url: Config.String("CLICKHOUSE_URL").pipe(Config.withDefault("http://localhost:8123")), @@ -110,7 +110,7 @@ example above does. When they have to travel _in the SQL_ — a gateway that forwards a statement verbatim, an endpoint that accepts one SQL string — the `/sql` subpath has the two functions for it: ```ts -import { parseStatement, withSettings } from "@maple-dev/effect-clickhouse/sql" +import { parseStatement, withSettings } from "@maple-dev/effect-orm/sql" const statement = withSettings( parseStatement(compiled.sql), diff --git a/docs/tables-and-types.md b/docs/tables-and-types.md index 15b45c3..affeec5 100644 --- a/docs/tables-and-types.md +++ b/docs/tables-and-types.md @@ -3,8 +3,8 @@ ## `table(name, columns)` ```ts -import * as CH from "@maple-dev/effect-clickhouse" -import * as T from "@maple-dev/effect-clickhouse/types" +import * as CH from "@maple-dev/effect-orm" +import * as T from "@maple-dev/effect-orm/types" const Events = CH.table("events", { OrgId: T.string, @@ -83,7 +83,7 @@ through nullable and array wrappers. Custom codecs retain their declared encodin provide an explicit result schema when different custom transforms need a particular encoding. > **Import the namespace.** Every constructor is on the root barrel too, but -> `import * as T from "@maple-dev/effect-clickhouse/types"` — as above — reads better than +> `import * as T from "@maple-dev/effect-orm/types"` — as above — reads better than > `CH.string` and keeps column types visually distinct from the query DSL. _(Backed by `docs/tables-and-types.md > Column types come from /types as a namespace`.)_ @@ -94,7 +94,7 @@ _(Backed by `docs/tables-and-types.md > Column types come from /types as a names `select` already infers output rows — but it is exported for writing your own helpers: ```ts -import type { InferTS } from "@maple-dev/effect-clickhouse" +import type { InferTS } from "@maple-dev/effect-orm" type Ms = InferTS // number ``` diff --git a/docs/testing.md b/docs/testing.md index 9a9ead9..1bd7531 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -22,9 +22,9 @@ fixtures under `tests/`, and TypeScript release scripts under `scripts/`; build For live tests against an existing local server: ```sh -EFFECT_CLICKHOUSE_TEST_URL=http://127.0.0.1:8123 \ -EFFECT_CLICKHOUSE_TEST_USER=maple \ -EFFECT_CLICKHOUSE_TEST_PASSWORD=maple \ +EFFECT_ORM_CLICKHOUSE_URL=http://127.0.0.1:8123 \ +EFFECT_ORM_CLICKHOUSE_USER=maple \ +EFFECT_ORM_CLICKHOUSE_PASSWORD=maple \ bun run test:clickhouse ``` diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index ea9d9ba..1de7635 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -7,7 +7,7 @@ or row decoding. [Running a query](./running-queries.md#error-boundaries) separa | Symptom | Likely cause | Fix | | ------------------------------------------------------------ | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| npm returns 404 for the builder | The package name or configured registry is incorrect. | Check `@maple-dev/effect-clickhouse` and your npm registry; see [Getting started](./getting-started.md#installation-and-compatibility). | +| npm returns 404 for the builder | The package name or configured registry is incorrect. | Check `@maple-dev/effect-orm` and your npm registry; see [Getting started](./getting-started.md#installation-and-compatibility). | | `Schema.TaggedError is not a function` | Effect 3 is installed or resolving ahead of Effect 4. | Install the documented Effect 4 version and inspect the resolved dependency tree. | | `ERR_REQUIRE_ESM` or an import cannot be loaded by `require` | The builder ships ESM. | Use ESM imports and `"type": "module"`, or your bundler's ESM support. | | A helper exists in source but not in the package | A deep source import or stale local build. | Use the seven public entry points and rebuild/reinstall your tarball. | @@ -24,7 +24,7 @@ or row decoding. [Running a query](./running-queries.md#error-boundaries) separa | `QueryBuilderDefect` | The DSL was used incorrectly. | Supply `select`, use order tuples, and keep parameter names valid. Do not treat it as a retryable database error. | | `.compileUnion` vs `.compile` type mismatch | Union queries have their own compiler. | Use `CH.compileUnion` for a union or wrap it with `CH.fromUnion` before `CH.compile`. | -Expected builder errors use the tag `@maple-dev/effect-clickhouse/QueryBuilderError`. +Expected builder errors use the tag `@maple-dev/effect-orm/QueryBuilderError`. [`catchTag`](./params-and-compilation.md#handling-compilation-failures) matches the full tag, not just `QueryBuilderError`. @@ -75,4 +75,4 @@ Include the package version, resolved Effect version, runtime, and ClickHouse ve the problem to a table declaration, a query, the parameter shapes, and the generated SQL. For decoding failures include a redacted wire row and `rowSchemaSource`. Remove credentials and personal data: parameters are interpolated into `compiled.sql`, so the SQL may contain -sensitive values. File a [GitHub issue](https://github.com/MapleTechLabs/effect-clickhouse/issues). +sensitive values. File a [GitHub issue](https://github.com/MapleTechLabs/effect-orm/issues). diff --git a/package.json b/package.json index 286c2f6..33b27e2 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,25 @@ { - "name": "@maple-dev/effect-clickhouse", + "name": "@maple-dev/effect-orm", "version": "0.2.0", - "description": "Type-safe ClickHouse queries, result decoding, and reproducible benchmarks for Effect and TypeScript", + "description": "Type-safe ClickHouse and Postgres queries, result decoding, and reproducible benchmarks for Effect and TypeScript", "keywords": [ "clickhouse", "effect", + "orm", + "postgres", "query-builder", "sql", "typescript" ], "homepage": "https://effect-clickhouse.maple.dev", "bugs": { - "url": "https://github.com/MapleTechLabs/effect-clickhouse/issues" + "url": "https://github.com/MapleTechLabs/effect-orm/issues" }, "license": "MIT", "author": "Makisuo, Inc.", "repository": { "type": "git", - "url": "git+https://github.com/MapleTechLabs/effect-clickhouse.git" + "url": "git+https://github.com/MapleTechLabs/effect-orm.git" }, "bin": { "ch-bench": "./dist/benchmark/bin.mjs" diff --git a/scripts/check-doc-examples.mjs b/scripts/check-doc-examples.mjs index 1a4fe03..6873608 100644 --- a/scripts/check-doc-examples.mjs +++ b/scripts/check-doc-examples.mjs @@ -46,7 +46,7 @@ try { ` import assert from "node:assert/strict" import { Effect } from "effect" -import * as CH from "@maple-dev/effect-clickhouse" +import * as CH from "@maple-dev/effect-orm" import { Events } from "./schema" const sql = (query: { sql: string }) => query.sql.replace(/\\s+/g, " ").trim() const quick = await import("./quick-start") @@ -98,7 +98,7 @@ const nullFilter = await import("./null-filter") assert.match(sql(nullFilter.compiled), /WHERE isNull\\(notes.Note\\)/) assert.deepEqual(await Effect.runPromise(nullFilter.compiled.decodeRows([{ Note: null }])), [{ Note: null }]) const escapedSql = await import("./escaped-sql") -const fragments = await import("@maple-dev/effect-clickhouse/sql") +const fragments = await import("@maple-dev/effect-orm/sql") assert.equal(escapedSql.predicate, "Name = " + fragments.compile(fragments.str("O'Reilly"))) assert.doesNotMatch(escapedSql.predicate, /\\[object Object\\]/) const postgres = await import("./postgres-quickstart") diff --git a/scripts/check-package.ts b/scripts/check-package.ts index a4a7abe..a545df7 100644 --- a/scripts/check-package.ts +++ b/scripts/check-package.ts @@ -18,7 +18,7 @@ const program = Effect.gen(function* () { const path = yield* Path.Path const root = yield* path.fromFileUrl(new URL("..", import.meta.url)) // Outside the workspace, automatically removed on success, failure or Ctrl+C. - const temporary = yield* fs.makeTempDirectoryScoped({ prefix: "effect-clickhouse-consumer-" }) + const temporary = yield* fs.makeTempDirectoryScoped({ prefix: "effect-orm-consumer-" }) const version = Effect.fn(function* (name: "effect" | "typescript" | "@types/node") { const file = yield* path.fromFileUrl(new URL(import.meta.resolve(`${name}/package.json`))) const text = yield* fs.readFileString(file) @@ -48,7 +48,7 @@ const program = Effect.gen(function* () { private: true, type: "module", dependencies: { - "@maple-dev/effect-clickhouse": `file:./${packed.filename}`, + "@maple-dev/effect-orm": `file:./${packed.filename}`, effect: yield* version("effect"), }, devDependencies: { diff --git a/scripts/release-support.ts b/scripts/release-support.ts index d3ad8e2..a18d1d3 100644 --- a/scripts/release-support.ts +++ b/scripts/release-support.ts @@ -2,12 +2,12 @@ import { Effect, Schema, Stream } from "effect" import { ChildProcess } from "effect/process" export class ReleaseCheckError extends Schema.TaggedError()( - "@maple-dev/effect-clickhouse/ReleaseCheckError", + "@maple-dev/effect-orm/ReleaseCheckError", { message: Schema.String, check: Schema.String }, ) {} export class CommandFailed extends Schema.TaggedError()( - "@maple-dev/effect-clickhouse/CommandFailed", + "@maple-dev/effect-orm/CommandFailed", { message: Schema.String, command: Schema.String, diff --git a/scripts/test-clickhouse.ts b/scripts/test-clickhouse.ts index 000645e..96380ea 100644 --- a/scripts/test-clickhouse.ts +++ b/scripts/test-clickhouse.ts @@ -5,11 +5,11 @@ import { check, runCommand } from "./release-support" const release = process.argv.includes("--release") const program = Effect.gen(function* () { - const endpoint = yield* Config.String("EFFECT_CLICKHOUSE_TEST_URL").pipe(Config.withDefault("")) + const endpoint = yield* Config.String("EFFECT_ORM_CLICKHOUSE_URL").pipe(Config.withDefault("")) yield* check( endpoint.trim().length > 0, "live-configuration", - "EFFECT_CLICKHOUSE_TEST_URL is required; refusing to skip live tests.", + "EFFECT_ORM_CLICKHOUSE_URL is required; refusing to skip live tests.", ) const path = yield* Path.Path const root = yield* path.fromFileUrl(new URL("..", import.meta.url)) diff --git a/src/benchmark/model.ts b/src/benchmark/model.ts index 2f301d9..46ce6cd 100644 --- a/src/benchmark/model.ts +++ b/src/benchmark/model.ts @@ -7,7 +7,7 @@ const Metric = Schema.NullOr(NonNegative) const Text = Schema.String.check(Schema.isMinLength(1)) export class BenchmarkError extends Schema.TaggedError()( - "@maple-dev/effect-clickhouse/BenchmarkError", + "@maple-dev/effect-orm/BenchmarkError", { message: Schema.String, queryId: Schema.optionalKey(Schema.String) }, ) {} diff --git a/src/ch/compile.test.ts b/src/ch/compile.test.ts index 39d29c7..046e18d 100644 --- a/src/ch/compile.test.ts +++ b/src/ch/compile.test.ts @@ -514,7 +514,7 @@ describe("compile puts failures in the error channel", () => { it.effect("a missing param value is a typed failure", () => Effect.gen(function* () { const error = yield* Effect.flip(CH.compile(query, {})) - expect(error._tag).toBe("@maple-dev/effect-clickhouse/QueryBuilderError") + expect(error._tag).toBe("@maple-dev/effect-orm/QueryBuilderError") expect(error.code).toBe("UnresolvedParam") expect(error.message).toContain("orgId") }), @@ -599,7 +599,7 @@ const expectDefect = (exit: Exit.Exit) => { const defect = Exit.isFailure(exit) ? Cause.findDefect(exit.cause) : undefined expect( defect && Result.isSuccess(defect) ? (defect.success as CH.QueryBuilderDefect)._tag : undefined, - ).toBe("@maple-dev/effect-clickhouse/QueryBuilderDefect") + ).toBe("@maple-dev/effect-orm/QueryBuilderDefect") } // Failures vs defects — the rule is on `QueryBuilderError` in ./errors. diff --git a/src/ch/compile.ts b/src/ch/compile.ts index 01e4f7d..08282c5 100644 --- a/src/ch/compile.ts +++ b/src/ch/compile.ts @@ -29,7 +29,7 @@ import { tenantBoundOf, tenantPredicatesOf, withTenantBound, type TenantPredicat export { QueryBuilderError } from "./errors" export class CompiledQueryDecodeError extends Schema.TaggedError()( - "@maple-dev/effect-clickhouse/CompiledQueryDecodeError", + "@maple-dev/effect-orm/CompiledQueryDecodeError", { message: Schema.String, rowIndex: Schema.Number, @@ -38,7 +38,7 @@ export class CompiledQueryDecodeError extends Schema.TaggedError()( - "@maple-dev/effect-clickhouse/CompiledQueryEncodeError", + "@maple-dev/effect-orm/CompiledQueryEncodeError", { message: Schema.String, rowIndex: Schema.Number, diff --git a/src/ch/errors.ts b/src/ch/errors.ts index f04ceee..282ca07 100644 --- a/src/ch/errors.ts +++ b/src/ch/errors.ts @@ -34,7 +34,7 @@ import { Schema } from "effect" * are defects however loudly they fail. */ export class QueryBuilderError extends Schema.TaggedError()( - "@maple-dev/effect-clickhouse/QueryBuilderError", + "@maple-dev/effect-orm/QueryBuilderError", { code: Schema.Literals(["UnresolvedParam", "InvalidLiteral", "InvalidArguments"]), message: Schema.String, @@ -51,6 +51,6 @@ export class QueryBuilderError extends Schema.TaggedError()( * where no `catchTag` can quietly swallow it. */ export class QueryBuilderDefect extends Schema.TaggedError()( - "@maple-dev/effect-clickhouse/QueryBuilderDefect", + "@maple-dev/effect-orm/QueryBuilderDefect", { message: Schema.String }, ) {} diff --git a/src/ch/subquery.test.ts b/src/ch/subquery.test.ts index 0689d53..6e4203d 100644 --- a/src/ch/subquery.test.ts +++ b/src/ch/subquery.test.ts @@ -247,7 +247,7 @@ describe("spliced sub-SELECTs", () => { .where(($) => [$.OrgId.eq(param.string("orgId")), $.TraceId.gte(cutoff)]) const error = yield* Effect.flip(CH.compile(outer, { orgId: "org_1" })) - expect(error._tag).toBe("@maple-dev/effect-clickhouse/QueryBuilderError") + expect(error._tag).toBe("@maple-dev/effect-orm/QueryBuilderError") expect(error.code).toBe("InvalidLiteral") }), ) diff --git a/src/docs-examples.test.ts b/src/docs-examples.test.ts index 7a3915f..0b91b53 100644 --- a/src/docs-examples.test.ts +++ b/src/docs-examples.test.ts @@ -619,7 +619,7 @@ describe("docs/decoding-results.md", () => { Effect.gen(function* () { const result = yield* Effect.flip(compiled().decodeRows([{ name: 42, count: 1 }])) - expect(result._tag).toBe("@maple-dev/effect-clickhouse/CompiledQueryDecodeError") + expect(result._tag).toBe("@maple-dev/effect-orm/CompiledQueryDecodeError") expect(result.rowIndex).toBe(0) }), ) diff --git a/src/index.ts b/src/index.ts index 7d0ec13..ce6f4f7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -// @maple-dev/effect-clickhouse — curated public API +// @maple-dev/effect-orm — curated public API // // A type-safe, immutable ClickHouse SQL query builder. The main entry point // re-exports the DSL under friendly names. For the raw ClickHouse function diff --git a/src/postgres.ts b/src/postgres.ts index 66c151f..1937dd3 100644 --- a/src/postgres.ts +++ b/src/postgres.ts @@ -1,4 +1,4 @@ -// @maple-dev/effect-clickhouse/postgres +// @maple-dev/effect-orm/postgres // // Postgres for the same query builder. Build queries with the root entry // (`table`, `from`, `param`, `unionAll`, the shared operators); declare diff --git a/src/sql/statement.ts b/src/sql/statement.ts index 0a4bb98..c1ecc9c 100644 --- a/src/sql/statement.ts +++ b/src/sql/statement.ts @@ -21,7 +21,7 @@ import { splitTerminalClauses } from "./terminal-clauses" // `undefined` in the parsed shape, and the codec encodes to SQL text rather than // to JSON, so key presence never reaches a wire format. export class ClickHouseStatement extends Schema.Class( - "@maple-dev/effect-clickhouse/ClickHouseStatement", + "@maple-dev/effect-orm/ClickHouseStatement", )({ body: Schema.String, settings: Schema.optional(Schema.String), diff --git a/tests/benchmark-regressions.test.ts b/tests/benchmark-regressions.test.ts index 4cd5fed..31c052b 100644 --- a/tests/benchmark-regressions.test.ts +++ b/tests/benchmark-regressions.test.ts @@ -4,12 +4,12 @@ import { makeHttpClient, makeHttpTransport } from "../src/benchmark/http" import { benchmarkSql } from "../src/benchmark/sql" import { parseStatement, withFormat } from "../src/sql/statement" -const endpoint = process.env.EFFECT_CLICKHOUSE_TEST_URL +const endpoint = process.env.EFFECT_ORM_CLICKHOUSE_URL describe.skipIf(!endpoint)("benchmark result and statement regressions against ClickHouse", () => { const client = makeHttpClient({ url: endpoint ?? "http://localhost:8123", - user: process.env.EFFECT_CLICKHOUSE_TEST_USER ?? "default", - password: process.env.EFFECT_CLICKHOUSE_TEST_PASSWORD ?? "", + user: process.env.EFFECT_ORM_CLICKHOUSE_USER ?? "default", + password: process.env.EFFECT_ORM_CLICKHOUSE_PASSWORD ?? "", }) const transport = makeHttpTransport(client, { timeoutSeconds: 10, diff --git a/tests/clickhouse-support.ts b/tests/clickhouse-support.ts index e48d818..efa0cad 100644 --- a/tests/clickhouse-support.ts +++ b/tests/clickhouse-support.ts @@ -1,13 +1,13 @@ import assert from "node:assert/strict" import { Effect, Schema } from "effect" import { HttpClient, HttpClientRequest } from "effect/http" -import type * as CH from "@maple-dev/effect-clickhouse" +import type * as CH from "@maple-dev/effect-orm" -// Opt in with EFFECT_CLICKHOUSE_TEST_URL, plus _USER and _PASSWORD if needed. +// Opt in with EFFECT_ORM_CLICKHOUSE_URL, plus _USER and _PASSWORD if needed. // All fixtures are SELECTs/CTEs; this suite creates no tables and writes no data. -export const endpoint = process.env.EFFECT_CLICKHOUSE_TEST_URL -const user = process.env.EFFECT_CLICKHOUSE_TEST_USER ?? "default" -const password = process.env.EFFECT_CLICKHOUSE_TEST_PASSWORD ?? "" +export const endpoint = process.env.EFFECT_ORM_CLICKHOUSE_URL +const user = process.env.EFFECT_ORM_CLICKHOUSE_USER ?? "default" +const password = process.env.EFFECT_ORM_CLICKHOUSE_PASSWORD ?? "" const WireRow = Schema.fromJsonString(Schema.Record(Schema.String, Schema.Unknown)) const decodeWireRow = Schema.decodeUnknownEffect(WireRow) diff --git a/tests/deep-builder.clickhouse.test.ts b/tests/deep-builder.clickhouse.test.ts index 40f71b6..5d60961 100644 --- a/tests/deep-builder.clickhouse.test.ts +++ b/tests/deep-builder.clickhouse.test.ts @@ -1,8 +1,8 @@ import { Effect } from "effect" import { FetchHttpClient } from "effect/http" import { describe, expect, it } from "@effect/vitest" -import * as CH from "@maple-dev/effect-clickhouse" -import * as T from "@maple-dev/effect-clickhouse/types" +import * as CH from "@maple-dev/effect-orm" +import * as T from "@maple-dev/effect-orm/types" import { endpoint, execute } from "./clickhouse-support" it.layer(FetchHttpClient.layer)("builder identity regressions", (it) => { diff --git a/tests/deep-codecs.clickhouse.test.ts b/tests/deep-codecs.clickhouse.test.ts index 1186d16..ade62d1 100644 --- a/tests/deep-codecs.clickhouse.test.ts +++ b/tests/deep-codecs.clickhouse.test.ts @@ -1,8 +1,8 @@ import { DateTime, Effect, Schema } from "effect" import { FetchHttpClient } from "effect/http" import { describe, expect, it } from "@effect/vitest" -import * as CH from "@maple-dev/effect-clickhouse" -import * as T from "@maple-dev/effect-clickhouse/types" +import * as CH from "@maple-dev/effect-orm" +import * as T from "@maple-dev/effect-orm/types" import { endpoint, execute } from "./clickhouse-support" const One = CH.table("system.one", {}) diff --git a/tests/dialect-cases.ts b/tests/dialect-cases.ts index 46c097e..be184d7 100644 --- a/tests/dialect-cases.ts +++ b/tests/dialect-cases.ts @@ -1,9 +1,9 @@ // Fixtures use only public entry points, resolved through the package's built dist. // Raw SQL supplies deterministic input rows; the operation under test uses the DSL. import { DateTime } from "effect" -import * as CH from "@maple-dev/effect-clickhouse" -import * as F from "@maple-dev/effect-clickhouse/expr" -import * as T from "@maple-dev/effect-clickhouse/types" +import * as CH from "@maple-dev/effect-orm" +import * as F from "@maple-dev/effect-orm/expr" +import * as T from "@maple-dev/effect-orm/types" export interface DialectCase { readonly metadata?: { readonly route: string; readonly tenantScope: CH.TenantScope } diff --git a/tests/dialect-coverage.test.ts b/tests/dialect-coverage.test.ts index 7c1aa38..21b8c95 100644 --- a/tests/dialect-coverage.test.ts +++ b/tests/dialect-coverage.test.ts @@ -1,7 +1,7 @@ import { readFileSync } from "node:fs" import { describe, expect, it } from "vitest" -import * as CH from "@maple-dev/effect-clickhouse" -import * as T from "@maple-dev/effect-clickhouse/types" +import * as CH from "@maple-dev/effect-orm" +import * as T from "@maple-dev/effect-orm/types" import { dialectCases, typeCases } from "./dialect-cases" // Discover methods and descriptors from built exports; canonical function names diff --git a/tests/package-consumer.mts b/tests/package-consumer.mts index d3ea8f5..ad1999d 100644 --- a/tests/package-consumer.mts +++ b/tests/package-consumer.mts @@ -2,13 +2,13 @@ // resolve dependencies or source files from Maple's workspace. import assert from "node:assert/strict" import { Effect, Schema } from "effect" -import * as CH from "@maple-dev/effect-clickhouse" -import * as F from "@maple-dev/effect-clickhouse/expr" -import * as T from "@maple-dev/effect-clickhouse/types" -import * as Bench from "@maple-dev/effect-clickhouse/benchmark" -import { makeHttpClient } from "@maple-dev/effect-clickhouse/benchmark/http" -import { runCli } from "@maple-dev/effect-clickhouse/benchmark/cli" -import * as SQL from "@maple-dev/effect-clickhouse/sql" +import * as CH from "@maple-dev/effect-orm" +import * as F from "@maple-dev/effect-orm/expr" +import * as T from "@maple-dev/effect-orm/types" +import * as Bench from "@maple-dev/effect-orm/benchmark" +import { makeHttpClient } from "@maple-dev/effect-orm/benchmark/http" +import { runCli } from "@maple-dev/effect-orm/benchmark/cli" +import * as SQL from "@maple-dev/effect-orm/sql" const events = CH.table("events", { id: T.uint64, name: T.string }) const query = CH.from(events) diff --git a/tests/publish-readiness.clickhouse.test.ts b/tests/publish-readiness.clickhouse.test.ts index d142912..d20cd55 100644 --- a/tests/publish-readiness.clickhouse.test.ts +++ b/tests/publish-readiness.clickhouse.test.ts @@ -1,8 +1,8 @@ import { DateTime, Effect } from "effect" import { FetchHttpClient } from "effect/http" import { describe, expect, it } from "@effect/vitest" -import * as CH from "@maple-dev/effect-clickhouse" -import * as T from "@maple-dev/effect-clickhouse/types" +import * as CH from "@maple-dev/effect-orm" +import * as T from "@maple-dev/effect-orm/types" import { endpoint, execute } from "./clickhouse-support"