Extends the DataStax driver's client options with additional configurations for service providers, enabling the customization of Cassandra client instances based on specific service requirements. This interface integrates native driver configurations with custom extensions, facilitating the connection to Cassandra databases, including managed services like Astra DB.

  • serviceProviderArgs: Optional. Contains the connection arguments for specific Cassandra service providers, such as Astra DB. This allows for detailed and service-specific client configurations, enhancing connectivity and functionality across different Cassandra environments.

Incorporating this interface into client creation processes ensures a comprehensive setup, encompassing both standard and extended options for robust and versatile Cassandra database interactions.

interface CassandraLibArgs {
    applicationName?: string;
    applicationVersion?: string;
    authProvider?: AuthProvider;
    batchSize?: number;
    cloud?: {
        secureConnectBundle: string | URL;
    };
    contactPoints?: string[];
    credentials?: {
        password: string;
        username: string;
    };
    dimensions: number;
    encoding?: {
        copyBuffer?: boolean;
        map?: Function;
        set?: Function;
        useBigIntAsLong?: boolean;
        useBigIntAsVarint?: boolean;
        useUndefinedAsUnset?: boolean;
    };
    graphOptions?: GraphOptions;
    id?: Uuid;
    indices?: Index[];
    isMetadataSyncEnabled?: boolean;
    keyspace: string;
    localDataCenter?: string;
    maxConcurrency?: number;
    maxPrepared?: number;
    maxRetries?: number;
    metadataColumns?: Column[];
    metrics?: ClientMetrics;
    monitorReporting?: {
        enabled?: boolean;
    };
    nonKeyColumns?: Column | Column[];
    onFailedAttempt?: FailedAttemptHandler;
    policies?: {
        addressResolution?: AddressTranslator;
        loadBalancing?: LoadBalancingPolicy;
        reconnection?: ReconnectionPolicy;
        retry?: RetryPolicy;
        speculativeExecution?: SpeculativeExecutionPolicy;
        timestampGeneration?: TimestampGenerator;
    };
    pooling?: {
        coreConnectionsPerHost?: {
            [key: number]: number;
        };
        heartBeatInterval?: number;
        maxRequestsPerConnection?: number;
        warmup?: boolean;
    };
    prepareOnAllHosts?: boolean;
    primaryKey: Column | Column[];
    profiles?: ExecutionProfile[];
    promiseFactory?: ((handler: ((callback: ((err: Error, result?: any) => void)) => void)) => Promise<any>);
    protocolOptions?: {
        maxSchemaAgreementWaitSeconds?: number;
        maxVersion?: number;
        noCompact?: boolean;
        port?: number;
    };
    queryOptions?: QueryOptions;
    rePrepareOnUp?: boolean;
    refreshSchemaDelay?: number;
    requestTracker?: RequestTracker;
    serviceProviderArgs?: CassandraServiceProviderArgs;
    socketOptions?: {
        coalescingThreshold?: number;
        connectTimeout?: number;
        defunctReadTimeoutThreshold?: number;
        keepAlive?: boolean;
        keepAliveDelay?: number;
        readTimeout?: number;
        tcpNoDelay?: boolean;
    };
    sslOptions?: ConnectionOptions;
    table: string;
    vectorType?: SupportedVectorTypes;
    withClause?: string;
}

Hierarchy (view full)

Properties

applicationName?: string
applicationVersion?: string
authProvider?: AuthProvider
batchSize?: number
cloud?: {
    secureConnectBundle: string | URL;
}
contactPoints?: string[]
credentials?: {
    password: string;
    username: string;
}
dimensions: number
encoding?: {
    copyBuffer?: boolean;
    map?: Function;
    set?: Function;
    useBigIntAsLong?: boolean;
    useBigIntAsVarint?: boolean;
    useUndefinedAsUnset?: boolean;
}
graphOptions?: GraphOptions
id?: Uuid
indices?: Index[]
isMetadataSyncEnabled?: boolean
keyspace: string
localDataCenter?: string
maxConcurrency?: number

The maximum number of concurrent calls that can be made. Defaults to Infinity, which means no limit.

maxPrepared?: number
maxRetries?: number

The maximum number of retries that can be made for a single call, with an exponential backoff between each attempt. Defaults to 6.

metadataColumns?: Column[]
metrics?: ClientMetrics
monitorReporting?: {
    enabled?: boolean;
}
nonKeyColumns?: Column | Column[]
onFailedAttempt?: FailedAttemptHandler

Custom handler to handle failed attempts. Takes the originally thrown error object as input, and should itself throw an error if the input error is not retryable.

policies?: {
    addressResolution?: AddressTranslator;
    loadBalancing?: LoadBalancingPolicy;
    reconnection?: ReconnectionPolicy;
    retry?: RetryPolicy;
    speculativeExecution?: SpeculativeExecutionPolicy;
    timestampGeneration?: TimestampGenerator;
}
pooling?: {
    coreConnectionsPerHost?: {
        [key: number]: number;
    };
    heartBeatInterval?: number;
    maxRequestsPerConnection?: number;
    warmup?: boolean;
}
prepareOnAllHosts?: boolean
primaryKey: Column | Column[]
profiles?: ExecutionProfile[]
promiseFactory?: ((handler: ((callback: ((err: Error, result?: any) => void)) => void)) => Promise<any>)
protocolOptions?: {
    maxSchemaAgreementWaitSeconds?: number;
    maxVersion?: number;
    noCompact?: boolean;
    port?: number;
}
queryOptions?: QueryOptions
rePrepareOnUp?: boolean
refreshSchemaDelay?: number
requestTracker?: RequestTracker
serviceProviderArgs?: CassandraServiceProviderArgs
socketOptions?: {
    coalescingThreshold?: number;
    connectTimeout?: number;
    defunctReadTimeoutThreshold?: number;
    keepAlive?: boolean;
    keepAliveDelay?: number;
    readTimeout?: number;
    tcpNoDelay?: boolean;
}
sslOptions?: ConnectionOptions
table: string
withClause?: string