Fast,   Fluid,   Effective

an open source iOS ORM, designed from the start to be low maintenance and natural to use, developers choose shark for its power and simplicity.

 

Simple to use, yet so powerful 

Originally known as DBAccess, but still retaining the same simple interface, with just a couple of lines of code getting you started, it is faster to get started than any other database system.

Real class objects are used and extended, with a simple persistence model and the datastore is always refactored to your class structures, with no effort from the developer.

Objects are retrieved using a FLUENT interface, but the same methods give you COUNT, SUM, GROUP & DISTINCT.

Your object model is tuneable with indexes and query optimisations and it is entirely thread-safe in every situation, in fact, you don't have to worry about it at all.

class Employee: SRKObject {
   var name: String?
   var age: Int?
}

var newEmployee = Employee() 
newEmployee.name = "Steve"
newEmployee.age = 54
newEmployee.commit()

let youngest = Employee.query()
   .whereWithFormat("age < %@", withParameters: [21])
   .orderBy("age")
   .limit(10)
   .fetch()
   

github

so-logo

Community developed, community supported

Shark had a growing user base as [DBAccess], but now as a fully open source project on GitHub developers from around the globe are taking it further and faster than was possible with just the original team alone. Completely re-written, but API compatible with the original, it takes the framework further into it's second generation whilst addressing the feedback given by developers over the past 4 years. 

Released under the MIT licence, the team do not seek to profit from the ORM.

Seamlessly integrate with your code 

We hate writing superfluous code, so when designing Shark we wanted all our developers to love how clean it was to use.  There is nothing worse than coding a monstrosity to just get a couple of objects back.  So careful attention was paid to usability, we don't expect developers to have to look at the manual to achieve something complicated, it should come naturally.

 

You hardly even know the code is there. 

// get the number of employees
func getNumberOfEmployees() -> UInt64 {
   return Employee.query().count()
}

//
func updateEmployees() {
   for result in Employee.query().fetch() {
      let employee = result as! Employee
      employee.lastModified = nil
      employee.commit()
   }
}

Obtaining the framework