Skip to content

Commit fae5998

Browse files
Merge pull request #890 from ClickHouse/main
1.23 beta3
2 parents b25cda1 + e942852 commit fae5998

402 files changed

Lines changed: 12169 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
- (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])
1212

13+
- 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])
14+
1315
# 1.22.0
1416

1517
## New features
@@ -78,6 +80,7 @@ await client.query({
7880
[#828]: https://github.com/ClickHouse/clickhouse-js/pull/828
7981
[#845]: https://github.com/ClickHouse/clickhouse-js/pull/845
8082
[#864]: https://github.com/ClickHouse/clickhouse-js/pull/864
83+
[#889]: https://github.com/ClickHouse/clickhouse-js/pull/889
8184

8285
## Bug Fixes
8386

packages/client-common/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export {
9696
} from "./clickhouse_types";
9797
export {
9898
type ClickHouseSettings,
99+
type ClickHouseSettingsInterface,
99100
type MergeTreeSettings,
100101
/** @deprecated Import `SettingsMap` from `@clickhouse/client` (Node.js) or `@clickhouse/client-web` (Web) instead. Importing it from `@clickhouse/client-common` is deprecated. */
101102
SettingsMap,

packages/client-common/src/settings.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,26 @@ export type ClickHouseSettings = Partial<ClickHouseServerSettings> &
16441644
Partial<ClickHouseHTTPSettings> &
16451645
Record<string, number | string | boolean | SettingsMap | undefined>;
16461646

1647+
/**
1648+
* A package-neutral, structural view of {@link ClickHouseSettings}.
1649+
*
1650+
* Identical to {@link ClickHouseSettings} except that the index signature does
1651+
* not include {@link SettingsMap}. `SettingsMap` is a class with a private
1652+
* member, so TypeScript compares it nominally; because `@clickhouse/client` and
1653+
* `@clickhouse/client-web` each bundle their own copy of this module, their
1654+
* `ClickHouseSettings` types are mutually unassignable. This interface omits the
1655+
* only nominal member, so it is structurally identical across all three packages
1656+
* and assignable into each package's `ClickHouseSettings`.
1657+
*
1658+
* Intended for consumers that share a single settings-producing helper across
1659+
* both the Node.js and Web clients and therefore cannot import a single concrete
1660+
* `ClickHouseSettings`. Note: values typed as {@link SettingsMap} cannot be
1661+
* carried through this type — use {@link ClickHouseSettings} if you need them.
1662+
*/
1663+
export type ClickHouseSettingsInterface = Partial<ClickHouseServerSettings> &
1664+
Partial<ClickHouseHTTPSettings> &
1665+
Record<string, number | string | boolean | undefined>;
1666+
16471667
export interface MergeTreeSettings {
16481668
/** Allow floating point as partition key */
16491669
allow_floating_point_partition_key?: Bool;

packages/client-node/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export {
3030
type ErrorLogParams,
3131
type WarnLogParams,
3232
type ClickHouseSettings,
33+
type ClickHouseSettingsInterface,
3334
type MergeTreeSettings,
3435
type Row,
3536
type ResponseJSON,

packages/client-web/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export {
2929
type ErrorLogParams,
3030
type WarnLogParams,
3131
type ClickHouseSettings,
32+
type ClickHouseSettingsInterface,
3233
type MergeTreeSettings,
3334
type Row,
3435
type ResponseJSON,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
project(chdt_datatype_parser CXX)
3+
4+
# A self-contained library: no dependency on the ClickHouse source tree.
5+
set(CMAKE_CXX_STANDARD 20)
6+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
set(CMAKE_CXX_EXTENSIONS OFF)
8+
9+
if(NOT CMAKE_BUILD_TYPE)
10+
set(CMAKE_BUILD_TYPE Release)
11+
endif()
12+
13+
# Warning flags are GCC/Clang-specific; guard them so MSVC builds still work.
14+
if(MSVC)
15+
add_compile_options(/W4)
16+
else()
17+
add_compile_options(-Wall -Wextra)
18+
endif()
19+
20+
add_library(chdt_datatype_parser
21+
src/lexer.cpp
22+
src/parser.cpp
23+
src/json.cpp
24+
)
25+
target_include_directories(chdt_datatype_parser PUBLIC include)
26+
27+
# CLI: read a data-type string, print its JSON AST. Exit non-zero on error.
28+
add_executable(chdt-parse tool/main.cpp)
29+
target_link_libraries(chdt-parse PRIVATE chdt_datatype_parser)
30+
31+
enable_testing()
32+
add_subdirectory(test)

0 commit comments

Comments
 (0)