Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/embeddinglayer/fastify-clickhouse
A Fastify Clickhouse Plugin
https://github.com/embeddinglayer/fastify-clickhouse
clickhouse fastify fastify-plugin
Last synced: 18 days ago
JSON representation
A Fastify Clickhouse Plugin
- Host: GitHub
- URL: https://github.com/embeddinglayer/fastify-clickhouse
- Owner: embeddinglayer
- License: mit
- Created: 2024-12-04T22:29:25.000Z (22 days ago)
- Default Branch: main
- Last Pushed: 2024-12-07T09:05:44.000Z (19 days ago)
- Last Synced: 2024-12-07T09:24:06.721Z (19 days ago)
- Topics: clickhouse, fastify, fastify-plugin
- Language: TypeScript
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fastify ClickHouse
A Fastify plugin that simplifies access to the ClickHouse client.
Code rewritten from [Fastify Prisma plugin](https://github.com/joggrdocs/fastify-prisma/blob/main/src/index.ts) to instead use the ClickHouse client.
## Installation
NPM
```bash
npm i fastify-clickhouse
```Yarn
```bash
yarn add fastify-clickhouse
```## Usage
You can register it with the clickhouse client config
```javascript
import fastifyClickHouse from 'fastify-clickhouse';
await server.register(fastifyClickHouse, {
clientConfig: {
url: 'localhost:8123',
username: "USERNAME",
password: "PASSWORD"
}
});
```Or pass a ClickHouse client instance
```javascript
import { createClient } from '@clickhouse/client';const clickhouse = await createClient({
url: 'localhost:8123',
username: "USERNAME",
password: "PASSWORD"
});server.register(fastifyClickHouse, clickhouse);
```- [ClickHouse Javascript Documentation](https://github.com/ClickHouse/clickhouse-js)