session-ios/SessionMessagingKit/Database/OWSPrimaryStorage.h

52 lines
1.4 KiB
C
Raw Normal View History

2020-11-11 00:58:56 +01:00
//
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
2020-11-25 06:15:16 +01:00
#import <SessionMessagingKit/OWSStorage.h>
2020-11-11 00:58:56 +01:00
NS_ASSUME_NONNULL_BEGIN
extern NSString *const OWSUIDatabaseConnectionWillUpdateNotification;
extern NSString *const OWSUIDatabaseConnectionDidUpdateNotification;
extern NSString *const OWSUIDatabaseConnectionWillUpdateExternallyNotification;
extern NSString *const OWSUIDatabaseConnectionDidUpdateExternallyNotification;
extern NSString *const OWSUIDatabaseConnectionNotificationsKey;
@interface OWSPrimaryStorage : OWSStorage
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initStorage;
+ (instancetype)sharedManager NS_SWIFT_NAME(shared());
@property (nonatomic, readonly) YapDatabaseConnection *uiDatabaseConnection;
@property (nonatomic, readonly) YapDatabaseConnection *dbReadConnection;
@property (nonatomic, readonly) YapDatabaseConnection *dbReadWriteConnection;
- (void)updateUIDatabaseConnectionToLatest;
+ (YapDatabaseConnection *)dbReadConnection;
+ (YapDatabaseConnection *)dbReadWriteConnection;
+ (nullable NSError *)migrateToSharedData;
+ (NSString *)databaseFilePath;
+ (NSString *)legacyDatabaseFilePath;
+ (NSString *)legacyDatabaseFilePath_SHM;
+ (NSString *)legacyDatabaseFilePath_WAL;
+ (NSString *)sharedDataDatabaseFilePath;
+ (NSString *)sharedDataDatabaseFilePath_SHM;
+ (NSString *)sharedDataDatabaseFilePath_WAL;
+ (void)protectFiles;
#pragma mark - Misc.
- (void)touchDbAsync;
@end
NS_ASSUME_NONNULL_END