Versions in this module Expand all Collapse all v1 v1.0.0 May 24, 2025 Changes in this version + var ErrDeviceIDMustBeSet = errors.New("device JID must be known before accessing database") + var ErrInvalidLength = errors.New("database returned byte array with illegal length") + var PostgresArrayWrapper func(any) interface + type CachedLIDMap struct + func NewCachedLIDMap(db *dbutil.Database) *CachedLIDMap + func (s *CachedLIDMap) FillCache(ctx context.Context) error + func (s *CachedLIDMap) GetLIDForPN(ctx context.Context, pn types.JID) (types.JID, error) + func (s *CachedLIDMap) GetPNForLID(ctx context.Context, lid types.JID) (types.JID, error) + func (s *CachedLIDMap) PutLIDMapping(ctx context.Context, lid, pn types.JID) error + func (s *CachedLIDMap) PutManyLIDMappings(ctx context.Context, mappings []store.LIDMapping) error + type Container struct + LIDMap *CachedLIDMap + func New(ctx context.Context, dialect, address string, log waLog.Logger) (*Container, error) + func NewWithDB(db *sql.DB, dialect string, log waLog.Logger) *Container + func NewWithWrappedDB(wrapped *dbutil.Database, log waLog.Logger) *Container + func (c *Container) Close() error + func (c *Container) DeleteDevice(ctx context.Context, store *store.Device) error + func (c *Container) GetAllDevices(ctx context.Context) ([]*store.Device, error) + func (c *Container) GetDevice(ctx context.Context, jid types.JID) (*store.Device, error) + func (c *Container) GetFirstDevice(ctx context.Context) (*store.Device, error) + func (c *Container) NewDevice() *store.Device + func (c *Container) PutDevice(ctx context.Context, device *store.Device) error + func (c *Container) Upgrade(ctx context.Context) error + type SQLStore struct + JID string + func NewSQLStore(c *Container, jid types.JID) *SQLStore + func (s *SQLStore) ClearBufferedEventPlaintext(ctx context.Context, ciphertextHash [32]byte) error + func (s *SQLStore) DeleteAllIdentities(ctx context.Context, phone string) error + func (s *SQLStore) DeleteAllSessions(ctx context.Context, phone string) error + func (s *SQLStore) DeleteAppStateMutationMACs(ctx context.Context, name string, indexMACs [][]byte) (err error) + func (s *SQLStore) DeleteAppStateVersion(ctx context.Context, name string) error + func (s *SQLStore) DeleteIdentity(ctx context.Context, address string) error + func (s *SQLStore) DeleteOldBufferedHashes(ctx context.Context) error + func (s *SQLStore) DeleteSession(ctx context.Context, address string) error + func (s *SQLStore) DoDecryptionTxn(ctx context.Context, fn func(context.Context) error) error + func (s *SQLStore) GenOnePreKey(ctx context.Context) (*keys.PreKey, error) + func (s *SQLStore) GetAllContacts(ctx context.Context) (map[types.JID]types.ContactInfo, error) + func (s *SQLStore) GetAppStateMutationMAC(ctx context.Context, name string, indexMAC []byte) (valueMAC []byte, err error) + func (s *SQLStore) GetAppStateSyncKey(ctx context.Context, id []byte) (*store.AppStateSyncKey, error) + func (s *SQLStore) GetAppStateVersion(ctx context.Context, name string) (version uint64, hash [128]byte, err error) + func (s *SQLStore) GetBufferedEvent(ctx context.Context, ciphertextHash [32]byte) (*store.BufferedEvent, error) + func (s *SQLStore) GetChatSettings(ctx context.Context, chat types.JID) (settings types.LocalChatSettings, err error) + func (s *SQLStore) GetContact(ctx context.Context, user types.JID) (types.ContactInfo, error) + func (s *SQLStore) GetLatestAppStateSyncKeyID(ctx context.Context) ([]byte, error) + func (s *SQLStore) GetMessageSecret(ctx context.Context, chat, sender types.JID, id types.MessageID) (secret []byte, err error) + func (s *SQLStore) GetOrGenPreKeys(ctx context.Context, count uint32) ([]*keys.PreKey, error) + func (s *SQLStore) GetPreKey(ctx context.Context, id uint32) (*keys.PreKey, error) + func (s *SQLStore) GetPrivacyToken(ctx context.Context, user types.JID) (*store.PrivacyToken, error) + func (s *SQLStore) GetSenderKey(ctx context.Context, group, user string) (key []byte, err error) + func (s *SQLStore) GetSession(ctx context.Context, address string) (session []byte, err error) + func (s *SQLStore) HasSession(ctx context.Context, address string) (has bool, err error) + func (s *SQLStore) IsTrustedIdentity(ctx context.Context, address string, key [32]byte) (bool, error) + func (s *SQLStore) MarkPreKeysAsUploaded(ctx context.Context, upToID uint32) error + func (s *SQLStore) MigratePNToLID(ctx context.Context, pn, lid types.JID) error + func (s *SQLStore) PutAllContactNames(ctx context.Context, contacts []store.ContactEntry) error + func (s *SQLStore) PutAppStateMutationMACs(ctx context.Context, name string, version uint64, ...) error + func (s *SQLStore) PutAppStateSyncKey(ctx context.Context, id []byte, key store.AppStateSyncKey) error + func (s *SQLStore) PutAppStateVersion(ctx context.Context, name string, version uint64, hash [128]byte) error + func (s *SQLStore) PutArchived(ctx context.Context, chat types.JID, archived bool) error + func (s *SQLStore) PutBufferedEvent(ctx context.Context, ciphertextHash [32]byte, plaintext []byte, ...) error + func (s *SQLStore) PutBusinessName(ctx context.Context, user types.JID, businessName string) (bool, string, error) + func (s *SQLStore) PutContactName(ctx context.Context, user types.JID, firstName, fullName string) error + func (s *SQLStore) PutIdentity(ctx context.Context, address string, key [32]byte) error + func (s *SQLStore) PutMessageSecret(ctx context.Context, chat, sender types.JID, id types.MessageID, secret []byte) (err error) + func (s *SQLStore) PutMessageSecrets(ctx context.Context, inserts []store.MessageSecretInsert) (err error) + func (s *SQLStore) PutMutedUntil(ctx context.Context, chat types.JID, mutedUntil time.Time) error + func (s *SQLStore) PutPinned(ctx context.Context, chat types.JID, pinned bool) error + func (s *SQLStore) PutPrivacyTokens(ctx context.Context, tokens ...store.PrivacyToken) error + func (s *SQLStore) PutPushName(ctx context.Context, user types.JID, pushName string) (bool, string, error) + func (s *SQLStore) PutSenderKey(ctx context.Context, group, user string, session []byte) error + func (s *SQLStore) PutSession(ctx context.Context, address string, session []byte) error + func (s *SQLStore) RemovePreKey(ctx context.Context, id uint32) error + func (s *SQLStore) UploadedPreKeyCount(ctx context.Context) (count int, err error)