@earth-app/collegedb
    Preparing search index...

    Interface InitializeFromEnvOptions

    Options for initializeFromEnv.

    1.2.4

    interface InitializeFromEnvOptions {
        coordinator?: DurableObjectNamespace<undefined>;
        debug?: boolean;
        disableAutoMigration?: boolean;
        hashShardMappings?: boolean;
        knownShardsCacheTtlMs?: number;
        kv?: KVStorage;
        mappingCacheTtlMs?: number;
        maxDatabaseSize?: number;
        migrationConcurrency?: number;
        primary?: unknown;
        primaryName?: string;
        reserved?: string[];
        shardLocations?: Record<string, D1Region | ShardLocation>;
        shardPrefixes?: string[];
        sizeCacheTtlMs?: number;
        sql?: DrizzleSqlTagLike;
        strategy?: ShardingStrategy | MixedShardingStrategy;
        targetRegion?: D1Region;
    }

    Hierarchy

    Index
    coordinator?: DurableObjectNamespace<undefined>

    Shard coordinator Durable Object

    debug?: boolean

    Enable debug logging for development and troubleshooting

    false
    

    1.0.6

    disableAutoMigration?: boolean

    Disable automatic migration detection and background migration (useful for testing)

    1.0.2

    hashShardMappings?: boolean

    Whether to hash shard mapping keys with SHA-256 for security and privacy. When enabled, primary keys are hashed before storing in KV, protecting sensitive data like emails from being visible in KV keys.

    true
    

    1.0.3

    knownShardsCacheTtlMs?: number

    In-memory TTL for known shard list cache.

    10000
    

    1.1.0

    Explicit KV store; when omitted, env.KV is detected and wrapped

    mappingCacheTtlMs?: number

    In-memory TTL for primary key to shard mapping cache.

    30000
    

    1.1.0

    maxDatabaseSize?: number

    Maximum database size in bytes. When set, shards that exceed this size are excluded from new allocations (existing mappings remain intact).

    When omitted, size-based filtering is disabled to avoid extra sizing queries. This significantly reduces routing latency for write-heavy workloads.

    1.0.8

    migrationConcurrency?: number

    Concurrency limit for migration mapping operations.

    25
    

    1.1.0

    primary?: unknown

    Explicit primary binding; defaults to env.DB when present

    primaryName?: string

    Shard name to register the primary binding under (default: 'db-primary')

    reserved?: string[]

    Binding names to never treat as a shard

    shardLocations?: Record<string, D1Region | ShardLocation>

    Geographic locations of each shard (required for location strategy)

    shardPrefixes?: string[]

    Binding-name prefixes that identify shards (default: ['DB_', 'DB-', 'db-'])

    sizeCacheTtlMs?: number

    In-memory TTL for shard size checks when maxDatabaseSize is enabled.

    30000
    

    1.1.0

    Drizzle sql tag, forwarded to toProvider for Drizzle bindings

    Default shard allocation strategy (can be single strategy or mixed strategy object)

    targetRegion?: D1Region

    Target region for location-based sharding