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
Returns
SessionRepository
Methods
create()
create(
entity):Session
Defined in: Data/Repositories/SessionRepository.ts:100
Create a new session
Parameters
entity
Returns
Implementation of
delete()
delete(
id):boolean
Defined in: Data/Repositories/SessionRepository.ts:170
Delete a session
Parameters
id
number
Returns
boolean
Implementation of
getAll()
getAll(
options?):Session[]
Defined in: Data/Repositories/SessionRepository.ts:33
Get all sessions
Parameters
options?
Returns
Session[]
Implementation of
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
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
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