Versions in this module Expand all Collapse all v0 v0.0.3 Aug 20, 2024 v0.0.1 Aug 20, 2024 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(interface{}) interface + var Upgrades = [...]upgradeFunc + type Container struct + DatabaseErrorHandler func(device *store.Device, action string, attemptIndex int, err error) (retry bool) + func New(dialect, address string, log waLog.Logger) (*Container, error) + func NewWithDB(db *sql.DB, dialect string, log waLog.Logger) *Container + func (c *Container) Close() error + func (c *Container) DeleteDevice(store *store.Device) error + func (c *Container) GetAllDevices() ([]*store.Device, error) + func (c *Container) GetDevice(jid types.JID) (*store.Device, error) + func (c *Container) GetFirstDevice() (*store.Device, error) + func (c *Container) NewDevice() *store.Device + func (c *Container) PutDevice(device *store.Device) error + func (c *Container) Upgrade() error + type SQLStore struct + JID string + func NewSQLStore(c *Container, jid types.JID) *SQLStore + func (s *SQLStore) DeleteAllIdentities(phone string) error + func (s *SQLStore) DeleteAllSessions(phone string) error + func (s *SQLStore) DeleteAppStateMutationMACs(name string, indexMACs [][]byte) (err error) + func (s *SQLStore) DeleteAppStateVersion(name string) error + func (s *SQLStore) DeleteIdentity(address string) error + func (s *SQLStore) DeleteSession(address string) error + func (s *SQLStore) GenOnePreKey() (*keys.PreKey, error) + func (s *SQLStore) GetAllContacts() (map[types.JID]types.ContactInfo, error) + func (s *SQLStore) GetAppStateMutationMAC(name string, indexMAC []byte) (valueMAC []byte, err error) + func (s *SQLStore) GetAppStateSyncKey(id []byte) (*store.AppStateSyncKey, error) + func (s *SQLStore) GetAppStateVersion(name string) (version uint64, hash [128]byte, err error) + func (s *SQLStore) GetChatSettings(chat types.JID) (settings types.LocalChatSettings, err error) + func (s *SQLStore) GetContact(user types.JID) (types.ContactInfo, error) + func (s *SQLStore) GetLatestAppStateSyncKeyID() ([]byte, error) + func (s *SQLStore) GetMessageSecret(chat, sender types.JID, id types.MessageID) (secret []byte, err error) + func (s *SQLStore) GetOrGenPreKeys(count uint32) ([]*keys.PreKey, error) + func (s *SQLStore) GetPreKey(id uint32) (*keys.PreKey, error) + func (s *SQLStore) GetPrivacyToken(user types.JID) (*store.PrivacyToken, error) + func (s *SQLStore) GetSenderKey(group, user string) (key []byte, err error) + func (s *SQLStore) GetSession(address string) (session []byte, err error) + func (s *SQLStore) HasSession(address string) (has bool, err error) + func (s *SQLStore) IsTrustedIdentity(address string, key [32]byte) (bool, error) + func (s *SQLStore) MarkPreKeysAsUploaded(upToID uint32) error + func (s *SQLStore) PutAllContactNames(contacts []store.ContactEntry) error + func (s *SQLStore) PutAppStateMutationMACs(name string, version uint64, mutations []store.AppStateMutationMAC) error + func (s *SQLStore) PutAppStateSyncKey(id []byte, key store.AppStateSyncKey) error + func (s *SQLStore) PutAppStateVersion(name string, version uint64, hash [128]byte) error + func (s *SQLStore) PutArchived(chat types.JID, archived bool) error + func (s *SQLStore) PutBusinessName(user types.JID, businessName string) (bool, string, error) + func (s *SQLStore) PutContactName(user types.JID, firstName, fullName string) error + func (s *SQLStore) PutIdentity(address string, key [32]byte) error + func (s *SQLStore) PutMessageSecret(chat, sender types.JID, id types.MessageID, secret []byte) (err error) + func (s *SQLStore) PutMessageSecrets(inserts []store.MessageSecretInsert) (err error) + func (s *SQLStore) PutMutedUntil(chat types.JID, mutedUntil time.Time) error + func (s *SQLStore) PutPinned(chat types.JID, pinned bool) error + func (s *SQLStore) PutPrivacyTokens(tokens ...store.PrivacyToken) error + func (s *SQLStore) PutPushName(user types.JID, pushName string) (bool, string, error) + func (s *SQLStore) PutSenderKey(group, user string, session []byte) error + func (s *SQLStore) PutSession(address string, session []byte) error + func (s *SQLStore) RemovePreKey(id uint32) error + func (s *SQLStore) UploadedPreKeyCount() (count int, err error)