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
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

- (Node.js, `@experimental`) Added an additive `connection?: Connection<Stream.Readable>` option to `createClient` that lets a caller plug an externally-built backend `Connection`-like object in place of the default HTTP(S) factory. Only supposed to be used for testing the `chDB` integration. ([#879])

- Added `ClickHouseSettingsInterface`, a package-neutral structural counterpart to `ClickHouseSettings`, exported from `@clickhouse/client`, `@clickhouse/client-web`, and `@clickhouse/client-common`. It is identical to `ClickHouseSettings` except that its index signature omits `SettingsMap` (a class with a private member, which TypeScript compares nominally). Because each client package now bundles its own copy of the common module, their `ClickHouseSettings` types are mutually unassignable; `ClickHouseSettingsInterface` is structurally identical across all three packages and assignable into each package's `ClickHouseSettings`, so a consumer that shares a single settings-producing helper across both the Node.js and Web clients can type it against this one type without casts. Values typed as `SettingsMap` cannot be carried through it — use `ClickHouseSettings` if you need them. ([#889])

# 1.22.0

## New features
Expand Down Expand Up @@ -78,6 +80,7 @@ await client.query({
[#828]: https://github.com/ClickHouse/clickhouse-js/pull/828
[#845]: https://github.com/ClickHouse/clickhouse-js/pull/845
[#864]: https://github.com/ClickHouse/clickhouse-js/pull/864
[#889]: https://github.com/ClickHouse/clickhouse-js/pull/889

## Bug Fixes

Expand Down
1 change: 1 addition & 0 deletions packages/client-common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export {
} from "./clickhouse_types";
export {
type ClickHouseSettings,
type ClickHouseSettingsInterface,
type MergeTreeSettings,
/** @deprecated Import `SettingsMap` from `@clickhouse/client` (Node.js) or `@clickhouse/client-web` (Web) instead. Importing it from `@clickhouse/client-common` is deprecated. */
SettingsMap,
Expand Down
20 changes: 20 additions & 0 deletions packages/client-common/src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1644,6 +1644,26 @@ export type ClickHouseSettings = Partial<ClickHouseServerSettings> &
Partial<ClickHouseHTTPSettings> &
Record<string, number | string | boolean | SettingsMap | undefined>;

/**
* A package-neutral, structural view of {@link ClickHouseSettings}.
*
* Identical to {@link ClickHouseSettings} except that the index signature does
* not include {@link SettingsMap}. `SettingsMap` is a class with a private
* member, so TypeScript compares it nominally; because `@clickhouse/client` and
* `@clickhouse/client-web` each bundle their own copy of this module, their
* `ClickHouseSettings` types are mutually unassignable. This interface omits the
* only nominal member, so it is structurally identical across all three packages
* and assignable into each package's `ClickHouseSettings`.
*
* Intended for consumers that share a single settings-producing helper across
* both the Node.js and Web clients and therefore cannot import a single concrete
* `ClickHouseSettings`. Note: values typed as {@link SettingsMap} cannot be
* carried through this type — use {@link ClickHouseSettings} if you need them.
*/
export type ClickHouseSettingsInterface = Partial<ClickHouseServerSettings> &
Partial<ClickHouseHTTPSettings> &
Record<string, number | string | boolean | undefined>;

export interface MergeTreeSettings {
/** Allow floating point as partition key */
allow_floating_point_partition_key?: Bool;
Expand Down
1 change: 1 addition & 0 deletions packages/client-node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export {
type ErrorLogParams,
type WarnLogParams,
type ClickHouseSettings,
type ClickHouseSettingsInterface,
type MergeTreeSettings,
type Row,
type ResponseJSON,
Expand Down
1 change: 1 addition & 0 deletions packages/client-web/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export {
type ErrorLogParams,
type WarnLogParams,
type ClickHouseSettings,
type ClickHouseSettingsInterface,
type MergeTreeSettings,
type Row,
type ResponseJSON,
Expand Down
1 change: 1 addition & 0 deletions type-parser/mini-parser-extracted/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
32 changes: 32 additions & 0 deletions type-parser/mini-parser-extracted/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
cmake_minimum_required(VERSION 3.16)
project(chdt_datatype_parser CXX)

# A self-contained library: no dependency on the ClickHouse source tree.
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

# Warning flags are GCC/Clang-specific; guard them so MSVC builds still work.
if(MSVC)
add_compile_options(/W4)
else()
add_compile_options(-Wall -Wextra)
endif()

add_library(chdt_datatype_parser
src/lexer.cpp
src/parser.cpp
src/json.cpp
)
target_include_directories(chdt_datatype_parser PUBLIC include)

# CLI: read a data-type string, print its JSON AST. Exit non-zero on error.
add_executable(chdt-parse tool/main.cpp)
target_link_libraries(chdt-parse PRIVATE chdt_datatype_parser)

enable_testing()
add_subdirectory(test)
Loading
Loading