Libraries
    Preparing search index...

    Type Alias PrimaryKeyOf<S>

    PrimaryKeyOf: S extends { "[COMPOSITE_PRIMARY_KEY_BRAND]"?: infer TCols }
        ? TCols extends readonly string[] ? TCols : never
        : {
            [K in keyof SchemaPropsForPk<S> & string]: IsPkBranded<
                SchemaPropsForPk<S>[K],
            > extends true
                ? K
                : never
        }[keyof SchemaPropsForPk<S> & string]

    Extract the primary-key column descriptor for a schema.

    Returns:

    • the literal property-key string for a single-column primary key (e.g. 'id'),
    • a tuple of property-key strings for a composite primary key (e.g. ['userId', 'roleId']),
    • or never if no primary key is declared.

    Composite primary keys are detected via the COMPOSITE_PRIMARY_KEY_BRAND placed on the object schema by .hasPrimaryKey([...] as const). Use as const on the column tuple to preserve ordering at the type level.

    Type Parameters

    • S extends ObjectSchemaBuilder<any, any, any, any, any, any, any>