Type Alias: LixSelectable<T>

LixSelectable<T> = { [K in keyof T]: SelectType<T[K]> }

Transform a type for select/query operations.

This type unwraps all LixGenerated markers, giving you the actual runtime types that will be returned from database queries. All fields are required and have their base types.

Use this type when defining the shape of data returned from queries or when passing entity data to UI components.

Type Parameters

T

T

Example

type Account = {
  id: LixGenerated<string>;
  name: string;
  email: string;
  created_at: LixGenerated<string>;
};

type AccountData = LixSelectable<Account>;
// Result: { id: string; name: string; email: string; created_at: string; }

// Query results have this shape
const accounts: AccountData[] = await db
  .selectFrom("account")
  .selectAll()
  .execute();

console.log(accounts[0].id);  // string (not LixGenerated<string>)