mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.4 KiB
C
52 lines
1.4 KiB
C
5 years ago
|
//
|
||
|
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
||
|
//
|
||
|
|
||
4 years ago
|
#import <SessionMessagingKit/OWSStorage.h>
|
||
5 years ago
|
|
||
|
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
|