Skip to main content Link Search Menu Expand Document (external link)

ClickhouseClient overview

Added in v1.0.0


Table of contents


compiler

makeCompiler

Signature

export declare const makeCompiler: (transform?: (_: string) => string) => any

Added in v1.0.0

constructor

layer

Signature

export declare const layer: (
  config: Config.Config.Wrap<ClickhouseClientConfig>
) => Layer.Layer<ClickhouseClient | Client.SqlClient, ConfigError | SqlError>

Added in v1.0.0

constructors

ClickhouseClientConfig (interface)

Signature

export interface ClickhouseClientConfig extends Clickhouse.ClickHouseClientConfigOptions {
  readonly spanAttributes?: Record<string, unknown> | undefined
  readonly transformResultNames?: ((str: string) => string) | undefined
  readonly transformQueryNames?: ((str: string) => string) | undefined
}

Added in v1.0.0

make

Signature

export declare const make: (options: ClickhouseClientConfig) => Effect.Effect<ClickhouseClient, SqlError, Scope.Scope>

Added in v1.0.0

custom types

ClickhouseCustom (type alias)

Signature

export type ClickhouseCustom = ClickhouseParam

Added in v1.0.0

fiber refs

currentClientMethod

Signature

export declare const currentClientMethod: FiberRef.FiberRef<"query" | "command" | "insert">

Added in v1.0.0

currentQueryId

Signature

export declare const currentQueryId: FiberRef.FiberRef<string | undefined>

Added in v1.0.0

models

ClickhouseClient (interface)

Signature

export interface ClickhouseClient extends Client.SqlClient {
  readonly [TypeId]: TypeId
  readonly config: ClickhouseClientConfig
  readonly param: (dataType: string, value: Statement.Primitive) => Statement.Fragment
  readonly asCommand: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>
  readonly insertQuery: <T = unknown>(options: {
    readonly table: string
    readonly values: Clickhouse.InsertValues<Readable, T>
    readonly format?: Clickhouse.DataFormat
  }) => Effect.Effect<Clickhouse.InsertResult, SqlError>
  readonly withQueryId: {
    (queryId: string): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>
    <A, E, R>(effect: Effect.Effect<A, E, R>, queryId: string): Effect.Effect<A, E, R>
  }
}

Added in v1.0.0

tags

ClickhouseClient

Signature

export declare const ClickhouseClient: any

Added in v1.0.0

type ids

TypeId

Signature

export declare const TypeId: typeof TypeId

Added in v1.0.0

TypeId (type alias)

Signature

export type TypeId = typeof TypeId

Added in v1.0.0