{"id":25168351,"url":"https://github.com/fidetro/swift-ffdb","last_synced_at":"2025-05-01T13:41:10.135Z","repository":{"id":62456507,"uuid":"107642965","full_name":"Fidetro/Swift-FFDB","owner":"Fidetro","description":"a Object/Relational Mapping (ORM) support to iOS and MacOS .Since SwiftFFDB is build on top of FMDB.","archived":false,"fork":false,"pushed_at":"2021-04-10T01:21:57.000Z","size":5567,"stargazers_count":22,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T16:21:48.527Z","etag":null,"topics":["cocoapods","fmdb","ios","macos","mysql","perfect-server","sqlite3","swift-package-manager","swift-server","swift5"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fidetro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-20T06:56:16.000Z","updated_at":"2022-11-13T15:23:20.000Z","dependencies_parsed_at":"2022-11-02T00:15:19.854Z","dependency_job_id":null,"html_url":"https://github.com/Fidetro/Swift-FFDB","commit_stats":null,"previous_names":["fidetro/swiftffdb"],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fidetro%2FSwift-FFDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fidetro%2FSwift-FFDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fidetro%2FSwift-FFDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fidetro%2FSwift-FFDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fidetro","download_url":"https://codeload.github.com/Fidetro/Swift-FFDB/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237915420,"owners_count":19386728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cocoapods","fmdb","ios","macos","mysql","perfect-server","sqlite3","swift-package-manager","swift-server","swift5"],"created_at":"2025-02-09T07:17:02.007Z","updated_at":"2025-02-09T07:17:02.488Z","avatar_url":"https://github.com/Fidetro.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# SwiftFFDB  \n### [中文文档](https://github.com/Fidetro/Swift-FFDB/blob/master/README_zh-cn.md)\n\n\n![](https://github.com/Fidetro/SwiftFFDB/blob/master/src/logo.png)  \n![](https://img.shields.io/github/license/Fidetro/Swift-FFDB.svg) ![](https://img.shields.io/badge/language-swift-orange.svg) [![](https://img.shields.io/cocoapods/v/SwiftFFDB.svg)](https://cocoapods.org/pods/SwiftFFDB) [![](https://img.shields.io/badge/weibo-@Karim_师霖风-red.svg)](https://weibo.com/u/2095454814)  \n\nSwiftFFDB is a Object/Relational Mapping (ORM) support to iOS and Perfect-Server library.Since SwiftFFDB is build on top of [FMDB](https://github.com/ccgus/fmdb).  \nif you use Objective-C,you can use [FFDB](https://github.com/fidetro/ffdb)  \n\n# Wiki\nMore examples of usage in the [wiki](https://github.com/Fidetro/Swift-FFDB/wiki)(unfinished)\n\n# Requirements\n## iOS\n* Build  Swift5.0 releases toolchain   \n* Deployment on iOS 8 or above  \n* depend [FMDB](https://github.com/ccgus/fmdb)\n\n# Installing\n## CocoaPod\nSwiftFFDB can be installed using CocoaPod\n```\n$ vim Podfile\n```\nThen,edit the Podfile,add SwiftFFDB:\n```\nplatform :ios, '8.0'\ntarget 'YouApp' do\nuse_frameworks!\npod 'SwiftFFDB'\nend\n```\n# Useage\n\n## Setting\nYou can check out the [example project](https://github.com/Fidetro/SwiftFFDB)\nif you use in iOS:\n```\nPerson.registerTable() //create table\n```\n\n## Create\ncreate table model would you look like this:\n```\nstruct Person:FFObject {\n    var primaryID: Int64?\n    \n    var name : String?\n    \n    static func ignoreProperties() -\u003e [String]? {\n        return nil\n    }\n    \n    static func customColumnsType() -\u003e [String : String]? {\n        return nil\n    }\n    \n    static func customColumns() -\u003e [String : String]? {\n        return nil\n    }\n\n    static func autoincrementColumn() -\u003e String? {\n        return \"primaryID\"\n    }\n}\n```\n\n## Insert\n```\nvar person = Person()\nperson.name = \"fidetro\"\nperson.insert()\n```\n## Select\n```\n// find all Object\nPerson.select(where: nil)\n// find name is 'fidetro' \nPerson.select(where: \"name = 'fidetro'\")\n```\n## Update\n```\n// update name is 'fidetro' to 'ffdb'\nPerson.update(set: \"name = ?\", where: \"name = ?\", values: [\"ffdb\",\"fidetro\"])  \n```\n## Delete\n```\n// find name is 'fidetro' \nlet personList = Person.select(where: \"name = 'fidetro'\")\n\nfor (let person in personList){\n    // delete this person in database\n    person.delete()\n}\n```\nalso you can:\n```\nFFDBManager.delete(Person.self, where: \"name = 'fidetro'\")\n```  \n# Architecture\n![](https://github.com/Fidetro/Swift-FFDB/blob/master/src/architecture.png)\n\n# Support\n`SwiftFFDB` is a personal open source project,but I happy to answer questions in [Issues](https://github.com/Fidetro/SwiftFFDB/issues) or email to zykzzzz@hotmail.com\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffidetro%2Fswift-ffdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffidetro%2Fswift-ffdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffidetro%2Fswift-ffdb/lists"}