Skip to content
🚀 This documentation is for unreal-orm 1.0.0 alpha which requires SurrealDB 2.0 alpha SDK. For the stable version, see npm.

TypedExpr

Defined in: define/table/types/select.ts:34

A SurrealQL expression with an associated TypeScript type. Created using the typed() helper function.

import { typed } from "unreal-orm";
const posts = await Post.select({
select: {
title: true,
commentCount: typed<number>(surql`count(<-comment)`),
},
});
// Type: { title: string; commentCount: number }[]

T = unknown

The TypeScript type of the expression result.

optional __type: T

Defined in: define/table/types/select.ts:38

Phantom type marker for type inference


expr: BoundQuery<unknown[]> | Expr

Defined in: define/table/types/select.ts:36

The underlying SurrealQL expression