-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added raw sql projections to support raw SQL handling
Generalised also projection definition
- Loading branch information
1 parent
b33be40
commit c76df48
Showing
5 changed files
with
97 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { DefaultRecord, Event, EventTypeOf, ReadEvent } from '../typing'; | ||
|
||
export type ProjectionHandler< | ||
EventType extends Event = Event, | ||
ProjectionHandlerContext extends DefaultRecord = DefaultRecord, | ||
> = ( | ||
events: ReadEvent<EventType>[], | ||
context: ProjectionHandlerContext, | ||
) => Promise<void> | void; | ||
|
||
export interface ProjectionDefintion< | ||
ProjectionType extends 'inline' | 'async', | ||
EventType extends Event = Event, | ||
ProjectionHandlerContext extends DefaultRecord = DefaultRecord, | ||
> { | ||
type: ProjectionType; | ||
name?: string; | ||
canHandle: EventTypeOf<EventType>[]; | ||
handle: ProjectionHandler<EventType, ProjectionHandlerContext>; | ||
} |