1.134.0 • Published 6 months ago

@biorate/clickhouse v1.134.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Clickhouse

Clickhouse connector

Examples:

import { inject, container, Types, Core } from '@biorate/inversion';
import { IConfig, Config } from '@biorate/config';
import { ClickhouseConnector, ClickhouseConfig } from '@biorate/clickhouse';

class Root extends Core() {
  @inject(ClickhouseConnector) public connector: ClickhouseConnector;
}

container.bind<IConfig>(Types.Config).to(Config).inSingletonScope();
container.bind<ClickhouseConnector>(ClickhouseConnector).toSelf().inSingletonScope();
container.bind<Root>(Root).toSelf().inSingletonScope();

container.get<IConfig>(Types.Config).merge({
  Clickhouse: [
    {
      name: 'connection',
      options: {},
    },
  ],
});

(async () => {
  const root = container.get<Root>(Root);
  await root.$run();
  const cursor = await root.connector
      .get()
      .query({ query: 'SELECT 1 AS result;', format: 'JSON' });
  const { data } = await cursor.json<{ result: number }>();
  console.log(data); // [{ result: 1 }]
})();

Learn

  • Documentation can be found here - docs.

Release History

See the CHANGELOG

License

MIT

Copyright (c) 2021-present Leonid Levkin (llevkin)

1.96.0

11 months ago

1.95.1

11 months ago

1.91.5

12 months ago

1.95.0

11 months ago

1.91.4

12 months ago

1.93.1

11 months ago

1.91.3

12 months ago

1.93.0

11 months ago

1.91.2

12 months ago

1.91.1

12 months ago

1.91.0

12 months ago

1.90.0

12 months ago

1.100.0

9 months ago

1.120.0

7 months ago

1.104.0

9 months ago

1.102.0

9 months ago

1.102.1

9 months ago

1.134.0

6 months ago

1.76.3

1 year ago

1.79.1

1 year ago

1.70.0

1 year ago

1.65.4

2 years ago

1.54.0

2 years ago

1.42.5

2 years ago

1.42.4

2 years ago

1.42.3

2 years ago

1.42.2

2 years ago

1.42.1

2 years ago

1.39.0

2 years ago

1.38.4

2 years ago

1.38.3

2 years ago

1.38.2

2 years ago

1.38.1

2 years ago

1.31.0

2 years ago