Giter VIP home page Giter VIP logo

egodatabase's People

Contributors

bbonifield avatar shnhrrsn avatar tru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

egodatabase's Issues

Crashing on executeQuery:parameters

Hello,

First of all thanks for creating such wonderful small framework wrapper for Sqlite for thread safety. I am trying to integrate it in my app that uses 3 threads to read/write content in database, It is working at first sight very well except I am getting crash regularly when trying to select rows from database. I am also not sure what is causing it but crashing on all system (10.8/10.9.5/10.10 too) mostly on same line number.
In my system I have created a shared instance of EGODatabase and using it for all DB related operation from all three threads. Please confirm if it is fine or I need to change it:
. Below are crash threads:

Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff8bf2bae6 fsync + 10
1 libsqlite3.dylib 0x00007fff88c7a858 unixSync + 56
2 libsqlite3.dylib 0x00007fff88c82dfe syncJournal + 414
3 libsqlite3.dylib 0x00007fff88c7a5f6 sqlite3PagerCommitPhaseOne + 1526
4 libsqlite3.dylib 0x00007fff88c6906d sqlite3BtreeCommitPhaseOne + 685
5 libsqlite3.dylib 0x00007fff88c2b933 sqlite3VdbeHalt + 3539
6 libsqlite3.dylib 0x00007fff88c5de4e sqlite3VdbeExec + 54766
7 libsqlite3.dylib 0x00007fff88c502ab sqlite3_step + 3691
8 com.xxx.xxx 0x0000000105585c16 -[EGODatabase executeUpdate:parameters:] + 678

And second is:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff885e9292 __kill + 10
1 com.xx.xx 0x0000000102b9118a CLSSignalHandler + 212
2 libsystem_platform.dylib 0x00007fff907625aa _sigtramp + 26
3 libsqlite3.dylib 0x00007fff8ec1235b sqlite3PExpr + 187
4 libsqlite3.dylib 0x00007fff8eb535a9 yy_reduce + 489
5 libsqlite3.dylib 0x00007fff8eb53326 sqlite3Parser + 278
6 libsqlite3.dylib 0x00007fff8eb520e1 sqlite3RunParser + 305
7 libsqlite3.dylib 0x00007fff8eb5197e sqlite3Prepare + 734
8 libsqlite3.dylib 0x00007fff8eb5157f sqlite3LockAndPrepare + 191
9 libsqlite3.dylib 0x00007fff8ebd7c7c sqlite3_prepare + 28
10 com.accessagility.wlancontroller 0x0000000102b3444d -[EGODatabase executeQuery:parameters:] + 381 (EGODatabase.m:261)
11 com.accessagility.wlancontroller 0x0000000102b341d2 -[EGODatabase executeQueryWithParameters:] + 754 (EGODatabase.m:238)
12 com.xxx.xxx 0x0000000102abe529 +[TSDatabase getTestProifleIDs:] + 473 (TSDatabase.m:69)

Any help will be appreciated greatly.

Thanks.
MP

Memory Leak

According to Instruments, there's a memory leak in - (BOOL)open. It specifically points to:

int err = sqlite3_open([databasePath fileSystemRepresentation], &handle);

If used frequently, this has a horrendous effect on RAM usage. Please fix! :)

- (EGODatabaseRequest*)requestWith... functions should return autoreleased values

Hello!

There is bunch of functions to create EGODatabaseRequest object in EGODatabase.h:

  • (EGODatabaseRequest_)requestWithQueryAndParameters:(NSString_)sql, ... NS_REQUIRES_NIL_TERMINATION;
  • (EGODatabaseRequest_)requestWithQuery:(NSString_)sql;
  • (EGODatabaseRequest_)requestWithQuery:(NSString_)sql parameters:(NSArray*)parameters;
  • (EGODatabaseRequest_)requestWithUpdateAndParameters:(NSString_)sql, ... NS_REQUIRES_NIL_TERMINATION;
  • (EGODatabaseRequest_)requestWithUpdate:(NSString_)sql;
  • (EGODatabaseRequest_)requestWithUpdate:(NSString_)sql parameters:(NSArray*)parameters;

According to Memory Management Policy (https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html) such functions should return autoreleased values, but these ones do not. In fact, I thought they return autoreleased value till checked the implementation.

NSOperationQueue Pause and Resume?

I want to create NSOperationQueue with max size 25.
And operation added to queue after checking queue is full or not.
How to check whether queue is full or not?
How to pause operation to add in the queue till queue gets empty?

ExecuteQuery - Non-UTF8 Characters

Hi,

I've just seen some crash logs in my app from this code:

} else if (sqlite3_column_text(statement,x) != NULL) {
[data addObject:@((char*)sqlite3_column_text(statement,x))];
}

Putting non-UTF8 characters into it seems to crash it (or at least it did when trying to display some Swedish text). I managed to fix it using this:

NSString *s = [NSString stringWithCString:(char *)sqlite3_column_text(statement,x) encoding:NSUTF8StringEncoding];
if (s == nil) {
s = [NSString stringWithCString:(char *)sqlite3_column_text(statement,x) encoding:NSASCIIStringEncoding];
}
[data addObject:s];

Not ideal, but it works for now. Might be worth looking into this though.

.

.

Err 5: database is locked

Using the library from the main thread and I get "Err 5: database is locked" after creating the database.

However, running it in GHUnit not show this.

Before this error I get: [EGODatabase] Query Failed, Database Busy:

Multiple query && BLOB type

Hello,

I am developing an application with an embedded sqlite3 database and I need to make multiple requests one after the other. Is there another way rather than increasing calls to "executeQuery:" method?

And other question. How do I get a line of type BLOB ?? I saw that we could retrieve int, long, double, bool, string and date but nothing for blob and I need to retrieve an image in the database.

Thanks for your answers.

.

.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.