# Variable withReplicas`Const`

withReplicas: <
TResultKind extends "sync"
| "async",
TRunResult,
TFullSchema extends Record<string, unknown>,
TSchema extends TablesRelationalConfig,
Q extends
BaseSQLiteDatabase<
TResultKind,
TRunResult,
TFullSchema,
TSchema extends Record<string, unknown>
? ExtractTablesWithRelations<TFullSchema>
: TSchema,
>,
>(
primary: Q,
replicas: [Q, ...Q[]],
getReplica?: (replicas: Q[]) => Q,
) => SQLiteWithReplicas<Q>

#### Type Declaration

- - <
    TResultKind extends "sync"
    | "async",
    TRunResult,
    TFullSchema extends Record<string, unknown>,
    TSchema extends TablesRelationalConfig,
    Q extends
    BaseSQLiteDatabase<
    TResultKind,
    TRunResult,
    TFullSchema,
    TSchema extends Record<string, unknown>
    ? ExtractTablesWithRelations<TFullSchema>
    : TSchema,
    >,
    >(
    primary: Q,
    replicas: [Q, ...Q[]],
    getReplica?: (replicas: Q[]) => Q,
    ): SQLiteWithReplicas<Q>

  - #### Type Parameters

    - TResultKind extends "sync" | "async"
    - TRunResult
    - TFullSchema extends Record<string, unknown>
    - TSchema extends TablesRelationalConfig
    - Q extends BaseSQLiteDatabase<
      TResultKind,
      TRunResult,
      TFullSchema,
      TSchema extends Record<string, unknown>
      ? ExtractTablesWithRelations<TFullSchema>
      : TSchema,
      >

    #### Parameters

    - primary: Q
    - replicas: [Q, ...Q[]]
    - `Optional` getReplica: (replicas: Q[]) => Q

    #### Returns SQLiteWithReplicas<Q>

- Defined in node_modules/.pnpm/drizzle-orm@0.44.6_@cloudflare+workers-types@4.20251014.0_@opentelemetry+api@1.9.0_@typ_31a6f5ca8f102af87864dd251ed08d88/node_modules/drizzle-orm/sqlite-core/db.d.ts:257