@fedify/botkit-sqlite@0.5.0
SQLite repository for BotKit
Classes
A repository for storing bot data using SQLite.
- addFollowee(): Promise<void>identifier: string,followeeId: URL,follow: FollowNo documentation available
- addFollower(): Promise<void>identifier: string,followRequestId: URL,follower: ActorNo documentation available
- addMessage(): Promise<void>identifier: string,id: Uuid,activity: Create | AnnounceNo documentation available
- addQuoteAuthorization(): Promise<void>identifier: string,id: Uuid,authorization: QuoteAuthorizationNo documentation available
- addQuoteAuthorizationReference(): Promise<void>identifier: string,authorization: URL,messageId: Uuid,attribution?: URLNo documentation available
- addSentFollow(): Promise<void>identifier: string,id: Uuid,follow: FollowNo documentation available
- cleanupFollower(): booleanidentifier: string,followerId: stringNo documentation available
- close(): void
Closes the database connection.
- countFollowers(identifier: string): Promise<number>No documentation available
- countMessages(identifier: string): Promise<number>No documentation available
- countVoters(): Promise<number>identifier: string,messageId: UuidNo documentation available
- countVotes(): Promise<Readonly<Record<string, number>>>identifier: string,messageId: UuidNo documentation available
- db: DatabaseSyncNo documentation available
- findFollowedBots(followeeId: URL): AsyncIterable<string>No documentation available
- findQuoteAuthorization(): Promise<QuoteAuthorization | undefined>identifier: string,interactingObject: URLNo documentation available
- findQuoteAuthorizationReference(): Promise<Uuid | undefined>identifier: string,authorization: URLNo documentation available
- findQuoteAuthorizationReferenceAttribution(): Promise<URL | undefined>identifier: string,authorization: URLNo documentation available
- findQuoteAuthorizationReferenceIdentifiers(authorization: URL): AsyncIterable<string>No documentation available
- forIdentifier(identifier: string): ActorScopedRepositoryNo documentation available
- getFollowee(): Promise<Follow | undefined>identifier: string,followeeId: URLNo documentation available
- getFollowers(): AsyncIterable<Actor>identifier: string,options?: RepositoryGetFollowersOptionsNo documentation available
- getKeyPairs(identifier: string): Promise<CryptoKeyPair[] | undefined>No documentation available
- getMessage(): Promise<Create | Announce | undefined>identifier: string,id: UuidNo documentation available
- getMessages(): AsyncIterable<Create | Announce>identifier: string,options?: RepositoryGetMessagesOptionsNo documentation available
- getQuoteAuthorization(): Promise<QuoteAuthorization | undefined>identifier: string,id: UuidNo documentation available
- getSentFollow(): Promise<Follow | undefined>identifier: string,id: UuidNo documentation available
- hasBotIdColumn(table: string): booleanNo documentation available
- hasColumn(): booleantable: string,column: stringNo documentation available
- hasFollower(): Promise<boolean>identifier: string,followerId: URLNo documentation available
- initializeTables(): voidNo documentation available
- migrate(identifier: string): Promise<void>
Migrates data stored by @fedify/botkit-sqlite 0.4 or earlier, which was not scoped by bot actor identifiers, so that it belongs to the given identifier. Rows carried over from a legacy database have the empty-string bot ID; this method assigns them to the identifier in a single transaction. It only acts when the database was actually rebuilt from a legacy schema, so data legitimately stored under an empty-string identifier is never touched, and calling it again is a no-op.
- rebuildLegacyTables(): void
Rebuilds tables created by @fedify/botkit-sqlite 0.4 or earlier, which had no
bot_idcolumn, into the bot-scoped schema. Existing rows get the empty-string bot ID; use SqliteRepository.migrate to assign them to a bot actor identifier. - removeFollowee(): Promise<Follow | undefined>identifier: string,followeeId: URLNo documentation available
- removeFollower(): Promise<Actor | undefined>identifier: string,followRequestId: URL,actorId: URLNo documentation available
- removeMessage(): Promise<Create | Announce | undefined>identifier: string,id: UuidNo documentation available
- removeQuoteAuthorization(): Promise<QuoteAuthorization | undefined>identifier: string,id: UuidNo documentation available
- removeQuoteAuthorizationReference(): Promise<void>identifier: string,authorization: URLNo documentation available
- removeSentFollow(): Promise<Follow | undefined>identifier: string,id: UuidNo documentation available
- setKeyPairs(): Promise<void>identifier: string,keyPairs: CryptoKeyPair[]No documentation available
- tableExists(table: string): booleanNo documentation available
- updateMessage(): Promise<boolean>identifier: string,id: Uuid,updater: (existing: Create | Announce) =>Create
| Announce
| undefined
| Promise<Create | Announce | undefined>No documentation available - vote(): Promise<void>identifier: string,messageId: Uuid,voterId: URL,option: stringNo documentation available
Interfaces
Options for creating a SQLite repository.