天道酬勤,学无止境

dbaccess

DBAccess creating custom DBAccessSettings

Question I am testing DBAccess in order to see if I can use it in a project. I have problems changing the location of the sqlite file, I want it to be in cache directory. Here is part of the code I wrote until now, in AppDelegate.m : - (DBAccessSettings*)getCustomSettings { DBAccessSettings *settings = [[DBAccessSettings alloc] init]; NSURL *applicationCachesDirectory = [[[NSFileManager defaultManager] URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask] lastObject]; settings.databaseLocation = [applicationCachesDirectory absoluteString]; settings.defaultDatabaseName = @"myDefaultDB"

2022-05-10 03:57:03    分类:技术分享    ios   dbaccess

iOS Swift import data from .sql file to existing SQLite database

Question I'm using SharkORM in my iOS Swift 3 app, what I'm trying to do is to import data to my SQLite database from a SQL script file, using the function: SharkORM.rawQuery("INSERT INTO `Unit` (Id,name,symbol) VALUES (1,'kg/m²','kg/m²')") However, I'm not able to add any record to my "Unit" table because I'm always getting the following error: unrecognized token: \"\'k/gm²\"" Anyone know why this could be happening? and if there is another way to import .sql file to my database even if not using SharkORM. Thanks in advance.

2021-11-10 19:47:27    分类:技术分享    ios   swift   sqlite   dbaccess

SharkORM Encrypted properties issue in iOS Swift 3

Question I'm working on iOS project with DB, I am using SharkORM and integrate it to my project using cocoa pods, my project is built using Swift 3. Everything is working perfectly, but now I need to add encrypted values to the DB and in order to test it I added a very simple code, I created a "User" class in which I defined a "test" property, this property is of type Double: dynamic var test: Double = 0; I also added the following code to the class to define "test" as encrypted property: override class func encryptedPropertiesForClass() -> [Any]! { return ["test"] } in order to read/write

2021-11-10 19:12:23    分类:技术分享    ios   swift   sqlite   dbaccess

DBAccess: long long value supprted or not?

Question I'm using dbaccess for my project. I want to know, Is dbaccess supported long long value or not? If I stored date timestamp 745665352687 than if I retrieved it, it returns -1572180756. I know sqlite supports long long value, but don't know about dbaccess. Can anyone help me? Thanx in adv. Answer1 Yes, long long is one of the supported types. I've looked into the problem, and all versions should work fine for your example above. I've created a class and assigned your example value. @interface Test : DBObject @property long long value; @end Output: --------------------------------------

2021-10-14 17:21:22    分类:技术分享    ios   objective-c   dbaccess

Relating two objects in DBAccess

Question I'm using dbaccess for my iOS project. How can I pass an array to dbaccess object? For example: I have dbobject like: @interface Member : DBObject @property (strong) NSString* firstname; @property (strong) NSString* lastName; @end @interface Group : DBObject @property (strong) NSString* groupName; @property (strong) NSString* adminName; @property (strong) Member* members; @end For this group, it has 4 member than How can I store all group members and group detail in one object and also how to retrieve them? Thanx in adv. Answer1 To answer the question I have re-modelled and provided

2021-09-20 04:04:04    分类:技术分享    ios   objective-c   dbaccess

Relating two objects in DBAccess

Question I'm using dbaccess for my iOS project. How can I pass an array to dbaccess object? For example: I have dbobject like: @interface Member : DBObject @property (strong) NSString* firstname; @property (strong) NSString* lastName; @end @interface Group : DBObject @property (strong) NSString* groupName; @property (strong) NSString* adminName; @property (strong) Member* members; @end For this group, it has 4 member than How can I store all group members and group detail in one object and also how to retrieve them? Thanx in adv. Answer1 To answer the question I have re-modelled and provided

2021-09-20 04:02:03    分类:技术分享    ios   objective-c   dbaccess

Relating two objects in DBAccess

Question I'm using dbaccess for my iOS project. How can I pass an array to dbaccess object? For example: I have dbobject like: @interface Member : DBObject @property (strong) NSString* firstname; @property (strong) NSString* lastName; @end @interface Group : DBObject @property (strong) NSString* groupName; @property (strong) NSString* adminName; @property (strong) Member* members; @end For this group, it has 4 member than How can I store all group members and group detail in one object and also how to retrieve them? Thanx in adv. Answer1 To answer the question I have re-modelled and provided

2021-09-20 04:00:07    分类:技术分享    ios   objective-c   dbaccess