MCPcopy Create free account
hub / github.com/AlexErrant/Pentive / templateSelection

Function templateSelection

app/src/sqlite/util.ts:180–202  ·  view source on GitHub ↗
(
	eb: ExpressionBuilder<DB, 'note' | 'card' | 'template'>,
)

Source from the content-addressed store, hash-verified

178>
179
180export function templateSelection(
181 eb: ExpressionBuilder<DB, 'note' | 'card' | 'template'>,
182) {
183 return [
184 'template.ankiId as template_ankiId',
185 'template.created as template_created',
186 'template.css as template_css',
187 'template.fields as template_fields',
188 'template.id as template_id',
189 'template.edited as template_edited',
190 'template.name as template_name',
191 'template.templateType as template_templateType',
192
193 jsonArrayFrom(
194 eb
195 .selectFrom('remoteTemplate')
196 .select(['uploadDate', 'nook', 'remoteId'])
197 .whereRef('note.templateId', '=', 'remoteTemplate.localId'),
198 ).as(
199 'remoteTemplate',
200 ) satisfies RemoteTemplateJsonArray as RemoteTemplateJsonArray,
201 ] as const
202}
203
204type TemplatePrefix<T> = {
205 [P in keyof T as `template_${string & P}`]: T[P]

Callers 1

getCardsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected