Skip to main content

Class: SessionRepository

Defined in: Data/Repositories/SessionRepository.ts:13

Repository for session entities Provides CRUD operations and queries for study sessions

Implements

Constructors

Constructor

new SessionRepository(sql): SessionRepository

Defined in: Data/Repositories/SessionRepository.ts:14

Parameters

sql

ISql

Returns

SessionRepository

Methods

create()

create(entity): Session

Defined in: Data/Repositories/SessionRepository.ts:100

Create a new session

Parameters

entity

Session

Returns

Session

Implementation of

ISessionRepository.create


delete()

delete(id): boolean

Defined in: Data/Repositories/SessionRepository.ts:170

Delete a session

Parameters

id

number

Returns

boolean

Implementation of

ISessionRepository.delete


getAll()

getAll(options?): Session[]

Defined in: Data/Repositories/SessionRepository.ts:33

Get all sessions

Parameters

options?

RepositoryQueryOptions

Returns

Session[]

Implementation of

ISessionRepository.getAll


getAutosaveSession()

getAutosaveSession(): Session | undefined

Defined in: Data/Repositories/SessionRepository.ts:75

Get the autosave session

Returns

Session | undefined

Implementation of

ISessionRepository.getAutosaveSession


getById()

getById(id): Session | undefined

Defined in: Data/Repositories/SessionRepository.ts:19

Get a session by ID

Parameters

id

number

Returns

Session | undefined

Implementation of

ISessionRepository.getById


getByName()

getByName(name): Session | undefined

Defined in: Data/Repositories/SessionRepository.ts:48

Get a session by name

Parameters

name

string

Returns

Session | undefined

Implementation of

ISessionRepository.getByName


getDefaultSession()

getDefaultSession(): Session | undefined

Defined in: Data/Repositories/SessionRepository.ts:62

Get the default session

Returns

Session | undefined

Implementation of

ISessionRepository.getDefaultSession


getRecentSessions()

getRecentSessions(limit?): Session[]

Defined in: Data/Repositories/SessionRepository.ts:88

Get recent sessions

Parameters

limit?

number = 10

Returns

Session[]

Implementation of

ISessionRepository.getRecentSessions


markSessionOpened()

markSessionOpened(id): void

Defined in: Data/Repositories/SessionRepository.ts:194

Update the last opened time for a session

Parameters

id

number

Returns

void

Implementation of

ISessionRepository.markSessionOpened


setAsDefault()

setAsDefault(id): boolean

Defined in: Data/Repositories/SessionRepository.ts:178

Set a session as the default session

Parameters

id

number

Returns

boolean

Implementation of

ISessionRepository.setAsDefault


update()

update(entity): Session

Defined in: Data/Repositories/SessionRepository.ts:134

Update an existing session

Parameters

entity

Session

Returns

Session

Implementation of

ISessionRepository.update